1 Loading in Data sets + Library packages.

## 
## The downloaded binary packages are in
##  /var/folders/7n/x74qctp91rng390gx0z9hmd80000gn/T//RtmpfyxiFj/downloaded_packages

2 Loading Dataset

options(future.globals.maxSize = 74 * 1024^3) # 55 GB
getOption("future.globals.maxSize") #59055800320
## [1] 79456894976
load(here("jk_code", "SO4analysis.rds"))
SO4$sample <- factor(SO4$sample, levels = c("SO1", "SO4", "SO3", "SO2"))

VlnPlot(SO4,"S100g",split.by = "treatment",group.by = "sample")
## The default behaviour of split.by has changed.
## Separate violin plots are now plotted side-by-side.
## To restore the old behaviour of a single split violin,
## set split.plot = TRUE.
##       
## This message will be shown once per session.
## Warning: The `slot` argument of `FetchData()` is deprecated as of SeuratObject 5.0.0.
## ℹ Please use the `layer` argument instead.
## ℹ The deprecated feature was likely used in the Seurat package.
##   Please report the issue at <https://github.com/satijalab/seurat/issues>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: `PackageCheck()` was deprecated in SeuratObject 5.0.0.
## ℹ Please use `rlang::check_installed()` instead.
## ℹ The deprecated feature was likely used in the Seurat package.
##   Please report the issue at <https://github.com/satijalab/seurat/issues>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

# Macula Densa Markers , Nos1, Avpr1a, Slc12a1, Ptgs2, and Slc9a2

VlnPlot(SO4, c("Nos1","Avpr1a","Slc12a1","Ptgs2","Slc9a2","Pappa2"),split.by = "treatment",group.by = "treatment")

DimPlot(SO4)

SO4 <- SO4[
  !grepl("^(mt-|Rp|Gm)|Rik$", rownames(SO4)),
  ,
  drop = FALSE
]
## Warning: The following arguments are not used: drop
DimPlot(SO4,group.by = "treatment",split.by = "treatment")

#compare each type 1 control to type 1 low_treatment

3 Markers of control vs low_salt up/down regulation

Upregulated = low salt, positive, activated by low_salt Downregulated = control, negative, supressed of low_salt

Idents(SO4) <- "subclass2_MD"
subtypes <- c('type_1', 'type_2','type_3','type_4')
markers_list <- list()

# forloop markers for each subtype

for (subtype in subtypes) {
  markers_list[[subtype]] <- FindMarkers(
    object = SO4,
    ident.1 = "low_salt",
    ident.2 = "control",
    group.by = "treatment",
    subset.ident = subtype,
    min.pct = 0.1,
    logfc.threshold = 0.25,
    only.pos = FALSE
  )
}
## Warning: The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
## ℹ Please use the `layer` argument instead.
## ℹ The deprecated feature was likely used in the Seurat package.
##   Please report the issue at <https://github.com/satijalab/seurat/issues>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## For a (much!) faster implementation of the Wilcoxon Rank Sum Test,
## (default method for FindMarkers) please install the presto package
## --------------------------------------------
## install.packages('devtools')
## devtools::install_github('immunogenomics/presto')
## --------------------------------------------
## After installation of presto, Seurat will automatically use the more 
## efficient implementation (no further action necessary).
## This message will be shown once per session
VlnPlot(SO4, features = "Pappa2", group.by = "treatment", split.by = "subclass_MD")

DimPlot(SO4, reduction = "umap", split.by = "treatment", label = TRUE)

table(SO4$subclass2_MD, SO4$treatment)
##         
##          control low_salt
##   type_1    3560     4950
##   type_2    1302      994
##   type_3     143      405
##   type_4      42       83

3.1 Grabbing each markers of each type low salt vs control

type_1 <- markers_list$type_1
type_2<- markers_list$type_2
type_3 <- markers_list$type_3
type_4 <- markers_list$type_4

4 Type 1

4.1 Type 1 Pathway Upregulated = Low salt

df<- type_1%>% arrange(desc(avg_log2FC))


df2 <- df %>% filter(p_val_adj < 0.05)


DEG_list <- df2

markers1up <- DEG_list %>% rownames_to_column(var="SYMBOL")


ENTREZ_list <- bitr(
  geneID = rownames(DEG_list),
  fromType = "SYMBOL",
  toType = "ENTREZID",
  OrgDb = org.Mm.eg.db
)
## 'select()' returned 1:1 mapping between keys and columns
## Warning in bitr(geneID = rownames(DEG_list), fromType = "SYMBOL", toType =
## "ENTREZID", : 4.01% of input gene IDs are fail to map...
markers1up <-  ENTREZ_list %>% inner_join(markers1up, by = "SYMBOL")

markers1up <-  markers1up %>% dplyr::filter(p_val_adj < 0.05)
#head(markers, n = 50)

pos.markers1up <-  markers1up %>% dplyr::filter(avg_log2FC > 0.5) %>%  arrange(desc(abs(avg_log2FC)))
#change around avg log value 

pos.ranks1up <- pos.markers1up$ENTREZID[abs(pos.markers1up$avg_log2FC) > 0]
#head(pos.ranks)

pos_go1up <- enrichGO(gene = pos.ranks1up,           #a vector of entrez gene id
                   OrgDb = "org.Mm.eg.db",    
                   ont = "BP",
                   readable = TRUE)              #whether mapping gene ID to gene Name

pos_go1up
## #
## # over-representation test
## #
## #...@organism     Mus musculus 
## #...@ontology     BP 
## #...@keytype      ENTREZID 
## #...@gene     chr [1:65] "16010" "239435" "23850" "19283" "211739" "70337" "19225" ...
## #...pvalues adjusted by 'BH' with cutoff <0.05 
## #...127 enriched terms found
## 'data.frame':    127 obs. of  12 variables:
##  $ ID            : chr  "GO:0006469" "GO:0071560" "GO:0033673" "GO:0071559" ...
##  $ Description   : chr  "negative regulation of protein kinase activity" "cellular response to transforming growth factor beta stimulus" "negative regulation of kinase activity" "response to transforming growth factor beta" ...
##  $ GeneRatio     : chr  "7/61" "8/61" "7/61" "8/61" ...
##  $ BgRatio       : chr  "178/28928" "281/28928" "191/28928" "288/28928" ...
##  $ RichFactor    : num  0.0393 0.0285 0.0366 0.0278 0.0326 ...
##  $ FoldEnrichment: num  18.6 13.5 17.4 13.2 15.4 ...
##  $ zScore        : num  10.86 9.68 10.44 9.54 9.77 ...
##  $ pvalue        : num  9.78e-08 1.35e-07 1.58e-07 1.63e-07 3.53e-07 ...
##  $ p.adjust      : num  7.36e-05 7.36e-05 7.36e-05 7.36e-05 1.16e-04 ...
##  $ qvalue        : num  4.98e-05 4.98e-05 4.98e-05 4.98e-05 7.87e-05 ...
##  $ geneID        : chr  "Cep85/Hspb1/Cdk5rap1/Cdkn1c/Bmp2/Rgs2/Spry1" "Fos/Cav2/Cdkn1c/Wnt10a/Bambi/Bmp2/Itgb8/Spry1" "Cep85/Hspb1/Cdk5rap1/Cdkn1c/Bmp2/Rgs2/Spry1" "Fos/Cav2/Cdkn1c/Wnt10a/Bambi/Bmp2/Itgb8/Spry1" ...
##  $ Count         : int  7 8 7 8 7 7 8 8 8 6 ...
## #...Citation
## G Yu. Thirteen years of clusterProfiler. The Innovation. 2024, 5(6):100722
 chart1up <- dotplot(pos_go1up) +
    ggtitle("type 1 upregulated lowsalt") +
    theme_classic() + 
    theme(
        plot.title = element_text(hjust = 0.5),
        legend.position = "left",
        axis.text.y = element_text(hjust = 0, size = 10)) +
    scale_y_discrete(position = "right", 
                     labels = function(x) str_wrap(x, width = 25))  # Wrap y-axis labels to 2 lines
## Scale for y is already present.
## Adding another scale for y, which will replace the existing scale.
chart1up

4.1.1 Type 1 Up Gene View

pathway_type1up <- strsplit(pos_go1up$geneID, "/")

names(pathway_type1up) <- pos_go1up$Description 

pathway_type1up
## $`negative regulation of protein kinase activity`
## [1] "Cep85"    "Hspb1"    "Cdk5rap1" "Cdkn1c"   "Bmp2"     "Rgs2"     "Spry1"   
## 
## $`cellular response to transforming growth factor beta stimulus`
## [1] "Fos"    "Cav2"   "Cdkn1c" "Wnt10a" "Bambi"  "Bmp2"   "Itgb8"  "Spry1" 
## 
## $`negative regulation of kinase activity`
## [1] "Cep85"    "Hspb1"    "Cdk5rap1" "Cdkn1c"   "Bmp2"     "Rgs2"     "Spry1"   
## 
## $`response to transforming growth factor beta`
## [1] "Fos"    "Cav2"   "Cdkn1c" "Wnt10a" "Bambi"  "Bmp2"   "Itgb8"  "Spry1" 
## 
## $`negative regulation of transferase activity`
## [1] "Cep85"    "Hspb1"    "Cdk5rap1" "Cdkn1c"   "Bmp2"     "Rgs2"     "Spry1"   
## 
## $`transforming growth factor beta receptor signaling pathway`
## [1] "Fos"    "Cav2"   "Cdkn1c" "Bambi"  "Bmp2"   "Itgb8"  "Spry1" 
## 
## $`transforming growth factor beta receptor superfamily signaling pathway`
## [1] "Fos"    "Cav2"   "Cdkn1c" "Bambi"  "Hfe"    "Bmp2"   "Itgb8"  "Spry1" 
## 
## $`negative regulation of phosphorus metabolic process`
## [1] "Cep85"    "Hspb1"    "Cdk5rap1" "Cdkn1c"   "Bmp2"     "Rgs2"     "Aldob"   
## [8] "Spry1"   
## 
## $`negative regulation of phosphate metabolic process`
## [1] "Cep85"    "Hspb1"    "Cdk5rap1" "Cdkn1c"   "Bmp2"     "Rgs2"     "Aldob"   
## [8] "Spry1"   
## 
## $`regulation of epithelial cell differentiation`
## [1] "Sfn"    "Cdkn1c" "F11r"   "Bmp2"   "Etv4"   "Spry1" 
## 
## $`cell surface receptor protein serine/threonine kinase signaling pathway`
## [1] "Fos"    "Cav2"   "Cdkn1c" "Bambi"  "Hfe"    "Bmp2"   "Itgb8"  "Spry1" 
## 
## $`negative regulation of protein phosphorylation`
## [1] "Cep85"    "Hspb1"    "Cdk5rap1" "Cdkn1c"   "Bmp2"     "Rgs2"     "Spry1"   
## 
## $`negative regulation of phosphorylation`
## [1] "Cep85"    "Hspb1"    "Cdk5rap1" "Cdkn1c"   "Bmp2"     "Rgs2"     "Spry1"   
## 
## $`regulation of protein kinase activity`
## [1] "Cep85"    "Hspb1"    "Cdk5rap1" "Sfn"      "Cdkn1c"   "Bmp2"     "Rgs2"    
## [8] "Spry1"   
## 
## $`skeletal muscle organ development`
## [1] "Mcub"  "Fos"   "Cav2"  "Btg2"  "Hspa8" "Mymx" 
## 
## $`regulation of transforming growth factor beta receptor signaling pathway`
## [1] "Cav2"   "Cdkn1c" "Bambi"  "Bmp2"   "Spry1" 
## 
## $`regulation of cellular response to transforming growth factor beta stimulus`
## [1] "Cav2"   "Cdkn1c" "Bambi"  "Bmp2"   "Spry1" 
## 
## $`protein refolding`
## [1] "Hspb1"  "Hspa8"  "Hspa1a"
## 
## $`muscle organ development`
## [1] "Mcub"  "Fos"   "Cav2"  "Btg2"  "Hspa8" "Mymx"  "Bmp2" 
## 
## $`regulation of transmembrane receptor protein serine/threonine kinase signaling pathway`
## [1] "Cav2"   "Cdkn1c" "Bambi"  "Hfe"    "Bmp2"   "Spry1" 
## 
## $`negative regulation of protein modification process`
## [1] "Cep85"    "Hspb1"    "Cdk5rap1" "Cdkn1c"   "Bmp2"     "Rgs2"     "Spry1"   
## 
## $`negative regulation of protein serine/threonine kinase activity`
## [1] "Cdk5rap1" "Bmp2"     "Rgs2"     "Spry1"   
## 
## $`response to heat`
## [1] "Ptgs2"  "Hspb1"  "Hspa8"  "Hspa1a"
## 
## $`negative regulation of transforming growth factor beta receptor signaling pathway`
## [1] "Cav2"  "Bambi" "Bmp2"  "Spry1"
## 
## $`cellular response to metal ion`
## [1] "Ptgs2" "Fos"   "Chp2"  "Hspa8" "Hfe"  
## 
## $`skeletal muscle tissue development`
## [1] "Mcub"  "Fos"   "Cav2"  "Btg2"  "Hspa8"
## 
## $`response to toxic substance`
## [1] "Ptgs2" "Lcn2"  "Fos"   "Ptges" "Pon2" 
## 
## $regeneration
## [1] "Mcub"   "Mymx"   "Scarf1" "Hfe"    "Cspg5" 
## 
## $`cell-substrate adhesion`
## [1] "Ptprz1" "Frem1"  "Bcl6"   "Limch1" "Itgb8"  "Cspg5" 
## 
## $`response to metal ion`
## [1] "Ptgs2" "Fos"   "Chp2"  "Hspa8" "Hfe"   "Aldob"
## 
## $`acute-phase response`
## [1] "Ptgs2" "Ptges" "Hfe"  
## 
## $`regulation of cyclin-dependent protein kinase activity`
## [1] "Cdk5rap1" "Sfn"      "Cdkn1c"  
## 
## $`negative regulation of MAP kinase activity`
## [1] "Bmp2"  "Rgs2"  "Spry1"
## 
## $`regulation of NADP metabolic process`
## [1] "Me1"   "Aldob"
## 
## $`regulation of lens fiber cell differentiation`
## [1] "Cdkn1c" "Spry1" 
## 
## $`response to phorbol 13-acetate 12-myristate`
## [1] "Fos"  "Btg2"
## 
## $`cellular response to phorbol 13-acetate 12-myristate`
## [1] "Fos"  "Btg2"
## 
## $`positive regulation of phosphatase activity`
## [1] "Chp2" "Bmp2"
## 
## $`regulation of fever generation`
## [1] "Ptgs2" "Ptges"
## 
## $`regulation of protein serine/threonine kinase activity`
## [1] "Cdk5rap1" "Sfn"      "Bmp2"     "Rgs2"     "Spry1"   
## 
## $`negative regulation of transmembrane receptor protein serine/threonine kinase signaling pathway`
## [1] "Cav2"  "Bambi" "Bmp2"  "Spry1"
## 
## $`positive regulation of dephosphorylation`
## [1] "Chp2" "Bmp2"
## 
## $`brown fat cell differentiation`
## [1] "Vstm2a" "Ptgs2"  "Rgs2"  
## 
## $`positive regulation of epithelial cell differentiation`
## [1] "Sfn"  "Bmp2" "Etv4"
## 
## $`fever generation`
## [1] "Ptgs2" "Ptges"
## 
## $`regulation of iron ion transport`
## [1] "Lcn2" "Hfe" 
## 
## $`chaperone-mediated protein folding`
## [1] "Hspb1"  "Hspa8"  "Hspa1a"
## 
## $`regulation of odontogenesis of dentin-containing tooth`
## [1] "Wnt10a" "Bmp2"  
## 
## $`negative regulation of epithelial cell proliferation`
## [1] "Cav2"   "Sfn"    "Cdkn1c" "Etv4"  
## 
## $`positive regulation of cell projection organization`
## [1] "Ptprz1" "Ache"   "Lcn2"   "Hspb1"  "Scarf1" "Rgs2"  
## 
## $`positive regulation of fat cell differentiation`
## [1] "Vstm2a" "Ptgs2"  "Bmp2"  
## 
## $`response to temperature stimulus`
## [1] "Ptgs2"  "Hspb1"  "Hspa8"  "Hspa1a"
## 
## $`regulation of heat generation`
## [1] "Ptgs2" "Ptges"
## 
## $`positive regulation of brown fat cell differentiation`
## [1] "Vstm2a" "Ptgs2" 
## 
## $`positive regulation of protein binding`
## [1] "Bambi" "Hfe"   "Bmp2" 
## 
## $`positive regulation of nucleocytoplasmic transport`
## [1] "Ptgs2" "Chp2"  "Sfn"  
## 
## $`negative regulation of cell adhesion`
## [1] "Ptprz1" "Hspb1"  "Bcl6"   "Hfe"    "Bmp2"  
## 
## $`response to BMP`
## [1] "Vstm2a" "Bambi"  "Hfe"    "Bmp2"  
## 
## $`cellular response to BMP stimulus`
## [1] "Vstm2a" "Bambi"  "Hfe"    "Bmp2"  
## 
## $`negative regulation of smooth muscle contraction`
## [1] "Ptgs2" "Rgs2" 
## 
## $`regulation of cellular response to growth factor stimulus`
## [1] "Cav2"   "Cdkn1c" "Bambi"  "Bmp2"   "Spry1" 
## 
## $`cellular response to chemical stress`
## [1] "Ptgs2" "Lcn2"  "Fos"   "Hspb1" "Hspa8"
## 
## $`temperature homeostasis`
## [1] "Ptgs2" "Ache"  "Lcn2"  "Ptges"
## 
## $`prostaglandin secretion`
## [1] "Ptgs2" "Ptges"
## 
## $`learning or memory`
## [1] "Ptprz1" "Ptgs2"  "Lcn2"   "Fos"    "Btg2"  
## 
## $`positive regulation by host of viral process`
## [1] "Cav2"  "Hspa8"
## 
## $`SMAD protein signal transduction`
## [1] "Fos"  "Hfe"  "Bmp2"
## 
## $`lens development in camera-type eye`
## [1] "Crybb1" "Cdkn1c" "Spry1" 
## 
## $`regulation of odontogenesis`
## [1] "Wnt10a" "Bmp2"  
## 
## $`positive regulation of epidermal cell differentiation`
## [1] "Sfn"  "Etv4"
## 
## $`negative regulation of cyclin-dependent protein kinase activity`
## [1] "Cdk5rap1" "Cdkn1c"  
## 
## $`negative regulation of cell-cell adhesion`
## [1] "Hspb1" "Bcl6"  "Hfe"   "Bmp2" 
## 
## $`regulation of phosphatase activity`
## [1] "Chp2" "Bmp2"
## 
## $`regulation of insulin-like growth factor receptor signaling pathway`
## [1] "Igfbp4" "Bmp2"  
## 
## $`regulation of animal organ morphogenesis`
## [1] "Wnt10a" "Bmp2"   "Spry1" 
## 
## $`positive regulation of protein localization to nucleus`
## [1] "Ptgs2" "Cav2"  "Chp2" 
## 
## $`organ induction`
## [1] "Bmp2"  "Spry1"
## 
## $`skeletal muscle cell differentiation`
## [1] "Mcub" "Fos"  "Btg2"
## 
## $`female pregnancy`
## [1] "Ptgs2" "Fos"   "Hfe"   "Rgs2" 
## 
## $`skeletal muscle cell proliferation`
## [1] "Fos"  "Cav2"
## 
## $`regulation of brown fat cell differentiation`
## [1] "Vstm2a" "Ptgs2" 
## 
## $`regulation of cell-substrate adhesion`
## [1] "Ptprz1" "Bcl6"   "Limch1" "Cspg5" 
## 
## $`regulation of epithelial to mesenchymal transition`
## [1] "Bambi" "Bmp2"  "Spry1"
## 
## $`positive regulation of transmembrane receptor protein serine/threonine kinase signaling pathway`
## [1] "Cdkn1c" "Hfe"    "Bmp2"  
## 
## $cognition
## [1] "Ptprz1" "Ptgs2"  "Lcn2"   "Fos"    "Btg2"  
## 
## $`regulation of small molecule metabolic process`
## [1] "Igfbp4" "Ptgs2"  "Me1"    "Bmp2"   "Aldob" 
## 
## $`cell-matrix adhesion`
## [1] "Frem1"  "Bcl6"   "Limch1" "Itgb8" 
## 
## $`positive regulation of neuron projection development`
## [1] "Ptprz1" "Hspb1"  "Scarf1" "Rgs2"  
## 
## $`heat generation`
## [1] "Ptgs2" "Ptges"
## 
## $`positive regulation of epidermis development`
## [1] "Sfn"  "Etv4"
## 
## $`negative regulation of muscle contraction`
## [1] "Ptgs2" "Rgs2" 
## 
## $`positive regulation of intracellular protein transport`
## [1] "Ptgs2" "Chp2"  "Sfn"  
## 
## $`positive regulation of endothelial cell migration`
## [1] "Ptgs2" "Lcn2"  "Hspb1"
## 
## $`prostaglandin transport`
## [1] "Ptgs2" "Ptges"
## 
## $`camera-type eye development`
## [1] "Ache"   "Crybb1" "Fos"    "Cdkn1c" "Spry1" 
## 
## $`prostaglandin biosynthetic process`
## [1] "Ptgs2" "Ptges"
## 
## $`regulation of animal organ formation`
## [1] "Bmp2"  "Spry1"
## 
## $`prostanoid biosynthetic process`
## [1] "Ptgs2" "Ptges"
## 
## $`cellular response to cadmium ion`
## [1] "Fos"   "Hspa8"
## 
## $`acute inflammatory response`
## [1] "Ptgs2" "Ptges" "Hfe"  
## 
## $`chaperone cofactor-dependent protein refolding`
## [1] "Hspa8"  "Hspa1a"
## 
## $`cardiac epithelial to mesenchymal transition`
## [1] "Bmp2"  "Spry1"
## 
## $`response to oxidative stress`
## [1] "Ptgs2" "Lcn2"  "Fos"   "Hspb1" "Hspa8"
## 
## $`leukocyte cell-cell adhesion`
## [1] "Hspb1" "Bcl6"  "F11r"  "Hfe"   "Cd83" 
## 
## $`cellular response to oxidative stress`
## [1] "Lcn2"  "Fos"   "Hspb1" "Hspa8"
## 
## $`multi-organism reproductive process`
## [1] "Ptgs2" "Fos"   "Hfe"   "Rgs2" 
## 
## $`mesenchymal cell differentiation`
## [1] "Wnt10a" "Bambi"  "Bmp2"   "Spry1" 
## 
## $`multi-multicellular organism process`
## [1] "Ptgs2" "Fos"   "Hfe"   "Rgs2" 
## 
## $`regulation of alpha-beta T cell activation`
## [1] "Bcl6" "Hfe"  "Cd83"
## 
## $`negative regulation of cytokine production involved in immune response`
## [1] "Bcl6" "Hfe" 
## 
## $`response to mechanical stimulus`
## [1] "Ptgs2" "Fos"   "Btg2"  "F11r" 
## 
## $`fat cell differentiation`
## [1] "Vstm2a" "Ptgs2"  "Bmp2"   "Rgs2"  
## 
## $`regulation of cell growth`
## [1] "Igfbp4" "Bcl6"   "Sfn"    "Hspa1a" "Rgs2"  
## 
## $`NADH metabolic process`
## [1] "Me1"   "Aldob"
## 
## $`regulation of dephosphorylation`
## [1] "Chp2" "Bmp2"
## 
## $`mitotic nuclear division`
## [1] "Cep85"  "Cav2"   "Cdkn1c" "Hspa1a"
## 
## $`regulation of nucleocytoplasmic transport`
## [1] "Ptgs2" "Chp2"  "Sfn"  
## 
## $`eye development`
## [1] "Ache"   "Crybb1" "Fos"    "Cdkn1c" "Spry1" 
## 
## $`visual system development`
## [1] "Ache"   "Crybb1" "Fos"    "Cdkn1c" "Spry1" 
## 
## $`specification of animal organ identity`
## [1] "Bmp2"  "Spry1"
## 
## $`developmental induction`
## [1] "Bmp2"  "Spry1"
## 
## $`positive regulation of SMAD protein signal transduction`
## [1] "Hfe"  "Bmp2"
## 
## $`lens fiber cell differentiation`
## [1] "Cdkn1c" "Spry1" 
## 
## $`positive regulation of animal organ morphogenesis`
## [1] "Bmp2"  "Spry1"
## 
## $`muscle cell proliferation`
## [1] "Ptgs2" "Fos"   "Cav2"  "Bmp2" 
## 
## $`negative regulation of T cell activation`
## [1] "Hspb1" "Bcl6"  "Hfe"  
## 
## $`sensory system development`
## [1] "Ache"   "Crybb1" "Fos"    "Cdkn1c" "Spry1"

4.2 Type 1 Pathway Downregulated = Control ( absence of low salt)

# Arrange and filter DEGs

df <- type_1 %>% arrange(desc(avg_log2FC))

df2 <- df %>% filter(p_val_adj < 0.05)

DEG_list <- df2

markers1down <- DEG_list %>% rownames_to_column(var="SYMBOL")

ENTREZ_list <- bitr(
  geneID = rownames(DEG_list),
  fromType = "SYMBOL",
  toType = "ENTREZID",
  OrgDb = org.Mm.eg.db
)
## 'select()' returned 1:1 mapping between keys and columns
## Warning in bitr(geneID = rownames(DEG_list), fromType = "SYMBOL", toType =
## "ENTREZID", : 4.01% of input gene IDs are fail to map...
markers1down <- ENTREZ_list %>% inner_join(markers1down, by = "SYMBOL")

markers1down <- markers1down %>% dplyr::filter(p_val_adj < 0.05)

pos.markers1down <- markers1down %>% dplyr::filter(avg_log2FC < 0) %>% arrange(desc(abs(avg_log2FC)))

pos.ranks1down <- pos.markers1down$ENTREZID[abs(pos.markers1down$avg_log2FC) > 0.2]

# GO enrichment for downregulated genes
pos_go1down <- enrichGO(
  gene = pos.ranks1down,
  OrgDb = org.Mm.eg.db,
  ont = "BP",
  readable = TRUE
)

pos_go1down
## #
## # over-representation test
## #
## #...@organism     Mus musculus 
## #...@ontology     BP 
## #...@keytype      ENTREZID 
## #...@gene     chr [1:104] "15395" "54156" "18703" "12309" "27528" "433229" "15925" ...
## #...pvalues adjusted by 'BH' with cutoff <0.05 
## #...13 enriched terms found
## 'data.frame':    13 obs. of  12 variables:
##  $ ID            : chr  "GO:0097250" "GO:0045333" "GO:0015980" "GO:0009060" ...
##  $ Description   : chr  "mitochondrial respirasome assembly" "cellular respiration" "energy derivation by oxidation of organic compounds" "aerobic respiration" ...
##  $ GeneRatio     : chr  "6/98" "8/98" "9/98" "7/98" ...
##  $ BgRatio       : chr  "114/28928" "271/28928" "380/28928" "206/28928" ...
##  $ RichFactor    : num  0.0526 0.0295 0.0237 0.034 0.0476 ...
##  $ FoldEnrichment: num  15.54 8.71 6.99 10.03 14.06 ...
##  $ zScore        : num  9.07 7.44 6.85 7.58 7.81 ...
##  $ pvalue        : num  2.57e-06 4.07e-06 5.96e-06 6.71e-06 2.97e-05 ...
##  $ p.adjust      : num  0.00309 0.00309 0.00309 0.00309 0.01096 ...
##  $ qvalue        : num  0.0026 0.0026 0.0026 0.0026 0.00922 ...
##  $ geneID        : chr  "Ndufa3/Fmc1/Pet100/Ndufb4c/Ndufa1/Ndufc1" "Ide/Ndufa3/Ndufa1/Cox6c/Ndufc1/Cs/Cox7c/Got2" "Ide/Ndufa3/Ugp2/Ndufa1/Cox6c/Ndufc1/Cs/Cox7c/Got2" "Ide/Ndufa3/Ndufa1/Cox6c/Ndufc1/Cs/Cox7c" ...
##  $ Count         : int  6 8 9 7 5 4 4 3 5 3 ...
## #...Citation
## G Yu. Thirteen years of clusterProfiler. The Innovation. 2024, 5(6):100722
# Visualization
chart1down <- dotplot(pos_go1down) +
  ggtitle("type 1 downregulated control") +
  theme_classic() +
  theme(
    plot.title = element_text(hjust = 0.5),
    legend.position = "left",
    axis.text.y = element_text(hjust = 0, size = 10)
  ) +
  scale_y_discrete(
    position = "right",
    labels = function(x) str_wrap(x, width = 25)
  )
## Scale for y is already present.
## Adding another scale for y, which will replace the existing scale.
chart1down

4.2.1 Type 1 Down Gene View

pathway_type1down <- strsplit(pos_go1down$geneID, "/")

names(pathway_type1down) <- pos_go1down$Description 

pathway_type1down
## $`mitochondrial respirasome assembly`
## [1] "Ndufa3"  "Fmc1"    "Pet100"  "Ndufb4c" "Ndufa1"  "Ndufc1" 
## 
## $`cellular respiration`
## [1] "Ide"    "Ndufa3" "Ndufa1" "Cox6c"  "Ndufc1" "Cs"     "Cox7c"  "Got2"  
## 
## $`energy derivation by oxidation of organic compounds`
## [1] "Ide"    "Ndufa3" "Ugp2"   "Ndufa1" "Cox6c"  "Ndufc1" "Cs"     "Cox7c" 
## [9] "Got2"  
## 
## $`aerobic respiration`
## [1] "Ide"    "Ndufa3" "Ndufa1" "Cox6c"  "Ndufc1" "Cs"     "Cox7c" 
## 
## $`mitochondrial respiratory chain complex assembly`
## [1] "Ndufa3"  "Pet100"  "Ndufb4c" "Ndufa1"  "Ndufc1" 
## 
## $`NADH dehydrogenase complex assembly`
## [1] "Ndufa3"  "Ndufb4c" "Ndufa1"  "Ndufc1" 
## 
## $`mitochondrial respiratory chain complex I assembly`
## [1] "Ndufa3"  "Ndufb4c" "Ndufa1"  "Ndufc1" 
## 
## $`activation of protein kinase B activity`
## [1] "Gas6" "Fgf1" "Ppia"
## 
## $`oxidative phosphorylation`
## [1] "Ndufa3" "Ndufa1" "Cox6c"  "Ndufc1" "Cox7c" 
## 
## $`peptidyl-proline modification`
## [1] "Fkbp11" "P3h2"   "Ppia"  
## 
## $`regulation of body fluid levels`
## [1] "Gas6"   "Apoe"   "Ptger3" "Plau"   "Kng1"   "Ppia"   "Celsr2"
## 
## $`lipid droplet organization`
## [1] "Pisd" "Chka" "Ppia"
## 
## $`glycerolipid metabolic process`
## [1] "Fabp5"  "Apoe"   "Pisd"   "Chka"   "Pla2g7" "Dpm3"   "Abhd2"

5 Type 2

5.1 Type 2 Pathway Upregulated = Low salt

df <- type_2 %>% arrange(desc(avg_log2FC))

df2 <- df %>% filter(p_val_adj < 0.05)

DEG_list <- df2

markers2up <- DEG_list %>% rownames_to_column(var="SYMBOL")

ENTREZ_list <- bitr(
  geneID = rownames(DEG_list),
  fromType = "SYMBOL",
  toType = "ENTREZID",
  OrgDb = org.Mm.eg.db
)
## 'select()' returned 1:1 mapping between keys and columns
## Warning in bitr(geneID = rownames(DEG_list), fromType = "SYMBOL", toType =
## "ENTREZID", : 3.02% of input gene IDs are fail to map...
markers2up <- ENTREZ_list %>% inner_join(markers2up, by = "SYMBOL")

markers2up <- markers2up %>% dplyr::filter(p_val_adj < 0.05)
#head(markers2up, n = 50)

pos.markers2up <- markers2up %>% dplyr::filter(avg_log2FC > 0) %>% arrange(desc(abs(avg_log2FC))) %>% head(200)
#change around avg log value 

pos.ranks2up <- pos.markers2up$ENTREZID[abs(pos.markers2up$avg_log2FC) > 0]
#head(pos.ranks2up)

pos_go2up <- enrichGO(gene = pos.ranks2up,           #a vector of entrez gene id
                   OrgDb = "org.Mm.eg.db",    
                   ont = "BP",
                   readable = TRUE)              #whether mapping gene ID to gene Name

pos_go2up
## #
## # over-representation test
## #
## #...@organism     Mus musculus 
## #...@ontology     BP 
## #...@keytype      ENTREZID 
## #...@gene     chr [1:200] "239435" "19225" "66815" "16010" "23850" "18039" "18612" ...
## #...pvalues adjusted by 'BH' with cutoff <0.05 
## #...37 enriched terms found
## 'data.frame':    37 obs. of  12 variables:
##  $ ID            : chr  "GO:0061077" "GO:0042026" "GO:0051085" "GO:0008217" ...
##  $ Description   : chr  "chaperone-mediated protein folding" "protein refolding" "chaperone cofactor-dependent protein refolding" "regulation of blood pressure" ...
##  $ GeneRatio     : chr  "7/193" "5/193" "5/193" "10/193" ...
##  $ BgRatio       : chr  "69/28928" "24/28928" "33/28928" "229/28928" ...
##  $ RichFactor    : num  0.1014 0.2083 0.1515 0.0437 0.0386 ...
##  $ FoldEnrichment: num  15.21 31.23 22.71 6.55 5.79 ...
##  $ zScore        : num  9.68 12.14 10.23 6.9 6.65 ...
##  $ pvalue        : num  4.01e-07 4.81e-07 2.56e-06 3.50e-06 3.73e-06 ...
##  $ p.adjust      : num  0.000671 0.000671 0.001621 0.001621 0.001621 ...
##  $ qvalue        : num  0.000562 0.000562 0.001359 0.001359 0.001359 ...
##  $ geneID        : chr  "Hspb1/Hspa1a/Hspa1b/Clu/Tor2a/Hspa5/Hspa8" "Hspb1/Hspa1a/Hspa1b/Hspa5/Hspa8" "Hspa1a/Hspa1b/Tor2a/Hspa5/Hspa8" "Ptgs2/Ier3/Emp2/Klk1b3/F11r/Manf/Klk1/Klk1b5/Scnn1a/Gna11" ...
##  $ Count         : int  7 5 5 10 11 10 8 5 10 10 ...
## #...Citation
## G Yu. Thirteen years of clusterProfiler. The Innovation. 2024, 5(6):100722
chart2up <- dotplot(pos_go2up) +
    ggtitle("type 2 upregulated lowsalt") +
    theme_classic() + 
    theme(
        plot.title = element_text(hjust = 0.5),
        legend.position = "left",
        axis.text.y = element_text(hjust = 0, size = 10)) +
    scale_y_discrete(position = "right", 
                     labels = function(x) str_wrap(x, width = 25))  # Wrap y-axis labels to 2 lines
## Scale for y is already present.
## Adding another scale for y, which will replace the existing scale.
chart2up

### Gene View

pathway_type2up <- strsplit(pos_go2up$geneID, "/")

names(pathway_type2up) <- pos_go2up$Description 

pathway_type2up
## $`chaperone-mediated protein folding`
## [1] "Hspb1"  "Hspa1a" "Hspa1b" "Clu"    "Tor2a"  "Hspa5"  "Hspa8" 
## 
## $`protein refolding`
## [1] "Hspb1"  "Hspa1a" "Hspa1b" "Hspa5"  "Hspa8" 
## 
## $`chaperone cofactor-dependent protein refolding`
## [1] "Hspa1a" "Hspa1b" "Tor2a"  "Hspa5"  "Hspa8" 
## 
## $`regulation of blood pressure`
##  [1] "Ptgs2"  "Ier3"   "Emp2"   "Klk1b3" "F11r"   "Manf"   "Klk1"   "Klk1b5"
##  [9] "Scnn1a" "Gna11" 
## 
## $`protein processing`
##  [1] "Klk1b3" "Immp2l" "Tysnd1" "Klk1"   "Klk1b5" "Anxa2"  "Mafb"   "Sec11c"
##  [9] "Scg5"   "Ggt1"   "Dhcr24"
## 
## $`female pregnancy`
##  [1] "Ptgs2"   "Fos"     "Junb"    "Rgs2"    "Emp2"    "Slc2a1"  "Il11ra1"
##  [8] "Maged2"  "Pla2g4a" "Vmp1"   
## 
## $`response to topologically incorrect protein`
## [1] "Hspb8"  "Hspb1"  "Hspa1a" "Manf"   "Clu"    "Eif2s1" "Hspa5"  "Cops5" 
## 
## $`'de novo' post-translational protein folding`
## [1] "Hspa1a" "Hspa1b" "Tor2a"  "Hspa5"  "Hspa8" 
## 
## $`multi-organism reproductive process`
##  [1] "Ptgs2"   "Fos"     "Junb"    "Rgs2"    "Emp2"    "Slc2a1"  "Il11ra1"
##  [8] "Maged2"  "Pla2g4a" "Vmp1"   
## 
## $`multi-multicellular organism process`
##  [1] "Ptgs2"   "Fos"     "Junb"    "Rgs2"    "Emp2"    "Slc2a1"  "Il11ra1"
##  [8] "Maged2"  "Pla2g4a" "Vmp1"   
## 
## $`'de novo' protein folding`
## [1] "Hspa1a" "Hspa1b" "Tor2a"  "Hspa5"  "Hspa8" 
## 
## $`response to unfolded protein`
## [1] "Hspb8"  "Hspb1"  "Hspa1a" "Manf"   "Eif2s1" "Hspa5"  "Cops5" 
## 
## $`zymogen activation`
## [1] "Klk1b3" "Klk1"   "Klk1b5" "Anxa2"  "Ggt1"   "Dhcr24"
## 
## $`response to phorbol 13-acetate 12-myristate`
## [1] "Fos"    "Adam15" "Btg2"  
## 
## $`cellular response to phorbol 13-acetate 12-myristate`
## [1] "Fos"    "Adam15" "Btg2"  
## 
## $`protein folding`
## [1] "Hspb1"   "Hspa1a"  "Hspa1b"  "Clu"     "Tor2a"   "Hspa5"   "Hspa8"  
## [8] "Dnajb11"
## 
## $`response to heat`
## [1] "Ptgs2"  "Hspb1"  "Hspa1a" "Hspa1b" "Eif2s1" "Hspa8" 
## 
## $`prostaglandin transport`
## [1] "Ptgs2"   "Ptges"   "Slco4a1" "Pla2g4a"
## 
## $`negative regulation of apoptotic signaling pathway`
## [1] "Ptgs2"  "Hspb1"  "Ier3"   "Hspa1b" "Clu"    "Gstp1"  "Pam16"  "Cx3cl1"
## [9] "Lgals3"
## 
## $`cellular modified amino acid metabolic process`
## [1] "Iyd"     "Slco4a1" "Sardh"   "Abhd12"  "Gstp1"   "Ggt1"    "Gsta4"  
## [8] "Mthfs"  
## 
## $decidualization
## [1] "Ptgs2"   "Junb"    "Il11ra1" "Pla2g4a"
## 
## $`organic anion transport`
##  [1] "Ptgs2"    "Ptges"    "Slco4a1"  "Arg2"     "Rgs2"     "Slc2a1"  
##  [7] "Kcnk1"    "G6pc3"    "Pla2g4a"  "Slc44a4"  "Slc25a16" "Gipc1"   
## 
## $`maternal process involved in female pregnancy`
## [1] "Ptgs2"   "Junb"    "Rgs2"    "Il11ra1" "Pla2g4a"
## 
## $`plasma membrane organization`
## [1] "Mymx"  "Emp2"  "Anxa2" "Clu"   "Mafb"  "Vmp1"  "Cd9"  
## 
## $`protein targeting`
## [1] "Immp2l" "Syngr2" "Clu"    "Pam16"  "Prnp"   "Srp54b" "Hspa5"  "Gipc1" 
## [9] "Hspa8" 
## 
## $`regulation of apoptotic signaling pathway`
##  [1] "Ptgs2"  "Hspb1"  "Ier3"   "Hspa1b" "Clu"    "Gstp1"  "Pam16"  "Cx3cl1"
##  [9] "Maged1" "Lgals3" "Ctsc"  
## 
## $`maternal placenta development`
## [1] "Ptgs2"   "Junb"    "Il11ra1" "Pla2g4a"
## 
## $`lipid transport`
##  [1] "Ptgs2"   "Ptges"   "Slco4a1" "Prelid2" "Ttc39b"  "Slc2a1"  "Anxa2"  
##  [8] "Pitpnb"  "Pla2g4a" "Vmp1"    "Cd320"  
## 
## $`regulation of systemic arterial blood pressure`
## [1] "Ier3"   "Emp2"   "Klk1b3" "Manf"   "Klk1"   "Klk1b5"
## 
## $`response to alcohol`
##  [1] "Nefl"   "Fos"    "Pmvk"   "Rgs2"   "Adam15" "Btg2"   "Gstp1"  "Scnn1a"
##  [9] "Ggt1"   "Hspa8" 
## 
## $`protein localization to plasma membrane`
## [1] "Emp2"   "F11r"   "Sfn"    "Anxa2"  "Ramp3"  "Krt18"  "Prnp"   "Lgals3"
## [9] "Pkdcc" 
## 
## $`prostaglandin secretion`
## [1] "Ptgs2"   "Ptges"   "Pla2g4a"
## 
## $`regulation of supramolecular fiber organization`
##  [1] "Capg"   "Limch1" "Hspa1a" "F11r"   "Hspa1b" "Clu"    "Grb2"   "Cx3cl1"
##  [9] "Tmsb4x" "Hspa8" 
## 
## $`negative regulation of amide metabolic process`
## [1] "Clu"    "Ormdl2" "Prnp"  
## 
## $`receptor recycling`
## [1] "Ache"    "Anxa2"   "Ramp3"   "Plekhj1"
## 
## $`regulation of protein kinase activity`
##  [1] "Hspb1"  "Cdkn1c" "Rgs2"   "Emp2"   "Sh3bp5" "Map2k3" "Sfn"    "Gstp1" 
##  [9] "Prnp"   "Vps25"  "Maged1"
## 
## $`cellular response to heat`
## [1] "Ptgs2"  "Hspa1b" "Eif2s1" "Hspa8"

5.2 Type 2 Pathway Downregulated = Control ( absence of low salt)

# Arrange and filter DEGs for type 2
df <- type_2 %>% arrange(desc(avg_log2FC))

df2 <- df %>% filter(p_val_adj < 0.05)

DEG_list <- df2

markers2down <- DEG_list %>% rownames_to_column(var="SYMBOL")

ENTREZ_list <- bitr(
  geneID = rownames(DEG_list),
  fromType = "SYMBOL",
  toType = "ENTREZID",
  OrgDb = org.Mm.eg.db
)
## 'select()' returned 1:1 mapping between keys and columns
## Warning in bitr(geneID = rownames(DEG_list), fromType = "SYMBOL", toType =
## "ENTREZID", : 3.02% of input gene IDs are fail to map...
markers2down <- ENTREZ_list %>% inner_join(markers2down, by = "SYMBOL")

markers2down <- markers2down %>% dplyr::filter(p_val_adj < 0.05)

pos.markers2down <- markers2down %>% dplyr::filter(avg_log2FC < 0) %>% arrange(desc(abs(avg_log2FC)))

pos.ranks2down <- pos.markers2down$ENTREZID[abs(pos.markers2down$avg_log2FC) > 0]

# GO enrichment for downregulated genes
pos_go2down <- enrichGO(
  gene = pos.ranks2down,
  OrgDb = org.Mm.eg.db,
  ont = "BP",
  readable = TRUE
)

pos_go2down
## #
## # over-representation test
## #
## #...@organism     Mus musculus 
## #...@ontology     BP 
## #...@keytype      ENTREZID 
## #...@gene     chr [1:21] "54156" "15925" "54608" "72514" "19218" "14180" "20503" "18792" ...
## #...pvalues adjusted by 'BH' with cutoff <0.05 
## #...10 enriched terms found
## 'data.frame':    10 obs. of  12 variables:
##  $ ID            : chr  "GO:0014910" "GO:0044344" "GO:0071774" "GO:0014909" ...
##  $ Description   : chr  "regulation of smooth muscle cell migration" "cellular response to fibroblast growth factor stimulus" "response to fibroblast growth factor" "smooth muscle cell migration" ...
##  $ GeneRatio     : chr  "3/21" "3/21" "3/21" "3/21" ...
##  $ BgRatio       : chr  "110/28928" "111/28928" "118/28928" "122/28928" ...
##  $ RichFactor    : num  0.0273 0.027 0.0254 0.0246 0.0217 ...
##  $ FoldEnrichment: num  37.6 37.2 35 33.9 29.9 ...
##  $ zScore        : num  10.36 10.31 9.98 9.81 9.19 ...
##  $ pvalue        : num  6.77e-05 6.95e-05 8.34e-05 9.21e-05 1.33e-04 ...
##  $ p.adjust      : num  0.0194 0.0194 0.0194 0.0194 0.0223 ...
##  $ qvalue        : num  0.0119 0.0119 0.0119 0.0119 0.0138 ...
##  $ geneID        : chr  "Abhd2/Fgf9/Plau" "Fgfbp3/Fgf9/Zfp36l1" "Fgfbp3/Fgf9/Zfp36l1" "Abhd2/Fgf9/Plau" ...
##  $ Count         : int  3 3 3 3 3 3 2 3 3 3
## #...Citation
## G Yu. Thirteen years of clusterProfiler. The Innovation. 2024, 5(6):100722
# Visualization
chart2down <- dotplot(pos_go2down) +
  ggtitle("type 2 downregulated control") +
  theme_classic() +
  theme(
    plot.title = element_text(hjust = 0.5),
    legend.position = "left",
    axis.text.y = element_text(hjust = 0, size = 10)
  ) +
  scale_y_discrete(
    position = "right",
    labels = function(x) str_wrap(x, width = 25)
  )
## Scale for y is already present.
## Adding another scale for y, which will replace the existing scale.
chart2down

5.2.1 Gene View

pathway_type2down <- strsplit(pos_go2down$geneID, "/")

names(pathway_type2down) <- pos_go2down$Description 

pathway_type2down
## $`regulation of smooth muscle cell migration`
## [1] "Abhd2" "Fgf9"  "Plau" 
## 
## $`cellular response to fibroblast growth factor stimulus`
## [1] "Fgfbp3"  "Fgf9"    "Zfp36l1"
## 
## $`response to fibroblast growth factor`
## [1] "Fgfbp3"  "Fgf9"    "Zfp36l1"
## 
## $`smooth muscle cell migration`
## [1] "Abhd2" "Fgf9"  "Plau" 
## 
## $`muscle cell migration`
## [1] "Abhd2" "Fgf9"  "Plau" 
## 
## $`regulation of mRNA processing`
## [1] "Zfp36l1" "Alkbh5"  "Rbm47"  
## 
## $`norepinephrine transport`
## [1] "Ptger3" "Actb"  
## 
## $`regulation of mRNA stability`
## [1] "Zfp36l1" "Alkbh5"  "Rbm47"  
## 
## $`regulation of RNA stability`
## [1] "Zfp36l1" "Alkbh5"  "Rbm47"  
## 
## $`regulation of mRNA catabolic process`
## [1] "Zfp36l1" "Alkbh5"  "Rbm47"

6 Type 3 Upregulated -> lowsalt

# Arrange and filter DEGs for type 3
df <- type_3 %>% arrange(desc(avg_log2FC))

df2 <- df %>% filter(p_val_adj < 0.05)

DEG_list <- df2

markers3up <- DEG_list %>% rownames_to_column(var="SYMBOL")

ENTREZ_list <- bitr(
  geneID = rownames(DEG_list),
  fromType = "SYMBOL",
  toType = "ENTREZID",
  OrgDb = org.Mm.eg.db
)
## 'select()' returned 1:1 mapping between keys and columns
## Warning in bitr(geneID = rownames(DEG_list), fromType = "SYMBOL", toType =
## "ENTREZID", : 21.05% of input gene IDs are fail to map...
markers3up <- ENTREZ_list %>% inner_join(markers3up, by = "SYMBOL")

markers3up <- markers3up %>% dplyr::filter(p_val_adj < 0.05)
#head(markers3up, n = 50)

pos.markers3up <- markers3up %>% dplyr::filter(avg_log2FC > 0) %>% arrange(desc(abs(avg_log2FC)))
#change around avg log value 

pos.ranks3up <- pos.markers3up$ENTREZID[abs(pos.markers3up$avg_log2FC) > 0]
#head(pos.ranks3up)

pos_go3up <- enrichGO(
  gene = pos.ranks3up,           # a vector of entrez gene id
  OrgDb = org.Mm.eg.db,    
  ont = "BP",
  readable = TRUE                # whether mapping gene ID to gene Name
)

pos_go3up
## #
## # over-representation test
## #
## #...@organism     Mus musculus 
## #...@ontology     BP 
## #...@keytype      ENTREZID 
## #...@gene     chr [1:7] "102436" "100040531" "232341" "56455" "16372" "80733" "20377"
## #...pvalues adjusted by 'BH' with cutoff <0.05 
## #...223 enriched terms found
## 'data.frame':    223 obs. of  12 variables:
##  $ ID            : chr  "GO:0090263" "GO:0035282" "GO:0030177" "GO:0001838" ...
##  $ Description   : chr  "positive regulation of canonical Wnt signaling pathway" "segmentation" "positive regulation of Wnt signaling pathway" "embryonic epithelial tube formation" ...
##  $ GeneRatio     : chr  "2/7" "2/7" "2/7" "2/7" ...
##  $ BgRatio       : chr  "110/28928" "118/28928" "145/28928" "154/28928" ...
##  $ RichFactor    : num  0.0182 0.0169 0.0138 0.013 0.012 ...
##  $ FoldEnrichment: num  75.1 70 57 53.7 49.5 ...
##  $ zScore        : num  12.12 11.69 10.52 10.2 9.78 ...
##  $ pvalue        : num  0.000297 0.000342 0.000515 0.000581 0.000683 ...
##  $ p.adjust      : num  0.0301 0.0301 0.0301 0.0301 0.0301 ...
##  $ qvalue        : num  0.00846 0.00846 0.00846 0.00846 0.00846 ...
##  $ geneID        : chr  "Wnk1/Sfrp1" "Irx2/Sfrp1" "Wnk1/Sfrp1" "Irx2/Sfrp1" ...
##  $ Count         : int  2 2 2 2 2 2 2 2 2 2 ...
## #...Citation
## G Yu. Thirteen years of clusterProfiler. The Innovation. 2024, 5(6):100722
chart3up <- dotplot(pos_go3up) +
  ggtitle("type 3 upregulated lowsalt") +
  theme_classic() + 
  theme(
    plot.title = element_text(hjust = 0.5),
    legend.position = "left",
    axis.text.y = element_text(hjust = 0, size = 10)
  ) +
  scale_y_discrete(
    position = "right", 
    labels = function(x) str_wrap(x, width = 25)
  )  # Wrap y-axis labels to 2 lines
## Scale for y is already present.
## Adding another scale for y, which will replace the existing scale.
chart3up

6.1 Gene View Upregulated Type 3

pathway_type3up <- strsplit(pos_go3up$geneID, "/")

names(pathway_type3up) <- pos_go3up$Description 

pathway_type3up
## $`positive regulation of canonical Wnt signaling pathway`
## [1] "Wnk1"  "Sfrp1"
## 
## $segmentation
## [1] "Irx2"  "Sfrp1"
## 
## $`positive regulation of Wnt signaling pathway`
## [1] "Wnk1"  "Sfrp1"
## 
## $`embryonic epithelial tube formation`
## [1] "Irx2"  "Sfrp1"
## 
## $`epithelial tube formation`
## [1] "Irx2"  "Sfrp1"
## 
## $`kidney epithelium development`
## [1] "Irx2"  "Sfrp1"
## 
## $`tube formation`
## [1] "Irx2"  "Sfrp1"
## 
## $`morphogenesis of embryonic epithelium`
## [1] "Irx2"  "Sfrp1"
## 
## $gastrulation
## [1] "Wnk1"  "Sfrp1"
## 
## $`negative regulation of secretion`
## [1] "Wnk1"  "Sfrp1"
## 
## $`regulation of insulin secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`negative regulation of protein localization`
## [1] "Wnk1"  "Sfrp1"
## 
## $`regulation of canonical Wnt signaling pathway`
## [1] "Wnk1"  "Sfrp1"
## 
## $`insulin secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`regulation of peptide hormone secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`regulation of peptide secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`regulation of peptide transport`
## [1] "Dynll1" "Sfrp1" 
## 
## $`canonical Wnt signaling pathway`
## [1] "Wnk1"  "Sfrp1"
## 
## $`regulation by virus of viral protein levels in host cell`
## [1] "Dynlt1f"
## 
## $`DNA strand resection involved in replication fork processing`
## [1] "Dynll1"
## 
## $`regulation of Wnt signaling pathway`
## [1] "Wnk1"  "Sfrp1"
## 
## $`peptide hormone secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`negative regulation of cell adhesion mediated by integrin`
## [1] "Wnk1"
## 
## $`negative regulation of heterotypic cell-cell adhesion`
## [1] "Wnk1"
## 
## $`protein insertion into ER membrane by stop-transfer membrane-anchor sequence`
## [1] "Wnk1"
## 
## $`regulation of cell-cell adhesion involved in gastrulation`
## [1] "Wnk1"
## 
## $`cellular response to X-ray`
## [1] "Sfrp1"
## 
## $`regulation of dopaminergic neuron differentiation`
## [1] "Sfrp1"
## 
## $`regulation of ribonucleoprotein complex localization`
## [1] "Wnk1"
## 
## $`negative regulation of phosphorylation`
## [1] "Dynll1" "Sfrp1" 
## 
## $`peptide secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`regulation of protein secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`regulation of cell-cell adhesion mediated by integrin`
## [1] "Wnk1"
## 
## $`prostate glandular acinus development`
## [1] "Sfrp1"
## 
## $`cell-cell adhesion involved in gastrulation`
## [1] "Wnk1"
## 
## $`ribonucleoprotein complex localization`
## [1] "Wnk1"
## 
## $`loop of Henle development`
## [1] "Irx2"
## 
## $`aminoacyl-tRNA metabolism involved in translational fidelity`
## [1] "Lars2"
## 
## $`positive regulation of non-motile cilium assembly`
## [1] "Dynll1"
## 
## $`regulation of hormone secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`peptide transport`
## [1] "Dynll1" "Sfrp1" 
## 
## $`dorsal/ventral axis specification`
## [1] "Sfrp1"
## 
## $`negative regulation of osteoblast proliferation`
## [1] "Sfrp1"
## 
## $`positive regulation of mitotic cytokinesis`
## [1] "Wnk1"
## 
## $`positive regulation of fibroblast apoptotic process`
## [1] "Sfrp1"
## 
## $`kidney development`
## [1] "Irx2"  "Sfrp1"
## 
## $`positive regulation of T cell chemotaxis`
## [1] "Wnk1"
## 
## $`bone trabecula formation`
## [1] "Sfrp1"
## 
## $`positive regulation of extrinsic apoptotic signaling pathway via death domain receptors`
## [1] "Sfrp1"
## 
## $`midbrain dopaminergic neuron differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of phosphorus metabolic process`
## [1] "Dynll1" "Sfrp1" 
## 
## $`negative regulation of phosphate metabolic process`
## [1] "Dynll1" "Sfrp1" 
## 
## $`regulation of T cell chemotaxis`
## [1] "Wnk1"
## 
## $`neural crest formation`
## [1] "Sfrp1"
## 
## $`pancreatic juice secretion`
## [1] "Wnk1"
## 
## $`branching involved in prostate gland morphogenesis`
## [1] "Sfrp1"
## 
## $`cellular response to prostaglandin E stimulus`
## [1] "Sfrp1"
## 
## $`regulation of mitotic cytokinesis`
## [1] "Wnk1"
## 
## $`renal system development`
## [1] "Irx2"  "Sfrp1"
## 
## $`cellular response to abiotic stimulus`
## [1] "Wnk1"  "Sfrp1"
## 
## $`cellular response to environmental stimulus`
## [1] "Wnk1"  "Sfrp1"
## 
## $`negative regulation of sodium ion transport`
## [1] "Wnk1"
## 
## $`intracellular chloride ion homeostasis`
## [1] "Wnk1"
## 
## $`intraciliary retrograde transport`
## [1] "Dynll1"
## 
## $`negative regulation of JUN kinase activity`
## [1] "Sfrp1"
## 
## $`regulation of RNA export from nucleus`
## [1] "Wnk1"
## 
## $`regulation of non-motile cilium assembly`
## [1] "Dynll1"
## 
## $`positive regulation of non-canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`epithelial tube morphogenesis`
## [1] "Irx2"  "Sfrp1"
## 
## $`amide transport`
## [1] "Dynll1" "Sfrp1" 
## 
## $`regulation of translational fidelity`
## [1] "Lars2"
## 
## $`intracellular monoatomic anion homeostasis`
## [1] "Wnk1"
## 
## $`hormone secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`negative regulation of protein modification process`
## [1] "Wnk1"  "Sfrp1"
## 
## $`hormone transport`
## [1] "Dynll1" "Sfrp1" 
## 
## $`convergent extension`
## [1] "Sfrp1"
## 
## $`negative regulation of androgen receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`bone trabecula morphogenesis`
## [1] "Sfrp1"
## 
## $`regulation of nucleobase-containing compound transport`
## [1] "Wnk1"
## 
## $`positive regulation of Rac protein signal transduction`
## [1] "Dynlt1f"
## 
## $`negative regulation of nitric oxide biosynthetic process`
## [1] "Dynll1"
## 
## $`cellular response to prostaglandin stimulus`
## [1] "Sfrp1"
## 
## $`positive regulation of lymphocyte chemotaxis`
## [1] "Wnk1"
## 
## $`negative regulation of nitric oxide metabolic process`
## [1] "Dynll1"
## 
## $`protein secretion`
## [1] "Dynll1" "Sfrp1" 
## 
## $`establishment of protein localization to extracellular region`
## [1] "Dynll1" "Sfrp1" 
## 
## $`cell-cell adhesion mediated by integrin`
## [1] "Wnk1"
## 
## $`negative regulation of bone remodeling`
## [1] "Sfrp1"
## 
## $`negative regulation of digestive system process`
## [1] "Wnk1"
## 
## $`regulation of type B pancreatic cell proliferation`
## [1] "Sfrp1"
## 
## $`protein localization to extracellular region`
## [1] "Dynll1" "Sfrp1" 
## 
## $regionalization
## [1] "Irx2"  "Sfrp1"
## 
## $`segment specification`
## [1] "Irx2"
## 
## $`negative regulation of DNA replication`
## [1] "Dynll1"
## 
## $`negative regulation of mitochondrial membrane permeability`
## [1] "Dynlt1f"
## 
## $`Wnt signaling pathway`
## [1] "Wnk1"  "Sfrp1"
## 
## $`positive regulation of cell projection organization`
## [1] "Dynlt1f" "Dynll1" 
## 
## $`cellular response to vitamin D`
## [1] "Sfrp1"
## 
## $`nephron tubule formation`
## [1] "Irx2"
## 
## $`negative regulation of membrane permeability`
## [1] "Dynlt1f"
## 
## $`T cell chemotaxis`
## [1] "Wnk1"
## 
## $`regulation of heterotypic cell-cell adhesion`
## [1] "Wnk1"
## 
## $`negative regulation of GTPase activity`
## [1] "Wnk1"
## 
## $`regulation of lymphocyte chemotaxis`
## [1] "Wnk1"
## 
## $`regulation of fibroblast apoptotic process`
## [1] "Sfrp1"
## 
## $`DNA-templated transcription termination`
## [1] "Wnk1"
## 
## $`chloride ion homeostasis`
## [1] "Wnk1"
## 
## $`positive regulation of systemic arterial blood pressure`
## [1] "Wnk1"
## 
## $`response to X-ray`
## [1] "Sfrp1"
## 
## $`negative regulation of tissue remodeling`
## [1] "Sfrp1"
## 
## $`mitochondrion distribution`
## [1] "Dynll1"
## 
## $`monoatomic anion homeostasis`
## [1] "Wnk1"
## 
## $`regulation of androgen receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`regulation of non-canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`fibroblast apoptotic process`
## [1] "Sfrp1"
## 
## $`protein insertion into ER membrane`
## [1] "Wnk1"
## 
## $`trabecula formation`
## [1] "Sfrp1"
## 
## $`cellular response to vitamin`
## [1] "Sfrp1"
## 
## $`regulation of osteoblast proliferation`
## [1] "Sfrp1"
## 
## $`negative regulation of protein localization to plasma membrane`
## [1] "Wnk1"
## 
## $`Wnt signaling pathway, planar cell polarity pathway`
## [1] "Sfrp1"
## 
## $`positive regulation of cilium assembly`
## [1] "Dynll1"
## 
## $`prostate gland epithelium morphogenesis`
## [1] "Sfrp1"
## 
## $`negative regulation of protein localization to cell periphery`
## [1] "Wnk1"
## 
## $`regulation of Rac protein signal transduction`
## [1] "Dynlt1f"
## 
## $`prostate gland morphogenesis`
## [1] "Sfrp1"
## 
## $`cellular hyperosmotic response`
## [1] "Wnk1"
## 
## $`establishment of mitochondrion localization`
## [1] "Dynll1"
## 
## $`potassium ion homeostasis`
## [1] "Wnk1"
## 
## $`axis elongation`
## [1] "Sfrp1"
## 
## $`response to vitamin D`
## [1] "Sfrp1"
## 
## $`response to prostaglandin E`
## [1] "Sfrp1"
## 
## $`negative regulation of B cell activation`
## [1] "Sfrp1"
## 
## $`proximal/distal pattern formation`
## [1] "Irx2"
## 
## $`osteoblast proliferation`
## [1] "Sfrp1"
## 
## $`cellular response to estradiol stimulus`
## [1] "Sfrp1"
## 
## $`positive regulation of potassium ion transmembrane transport`
## [1] "Wnk1"
## 
## $`positive regulation of T cell migration`
## [1] "Wnk1"
## 
## $`establishment of planar polarity`
## [1] "Sfrp1"
## 
## $`establishment of tissue polarity`
## [1] "Sfrp1"
## 
## $`type B pancreatic cell proliferation`
## [1] "Sfrp1"
## 
## $`regulation of B cell differentiation`
## [1] "Sfrp1"
## 
## $`cell volume homeostasis`
## [1] "Wnk1"
## 
## $`negative regulation of epithelial to mesenchymal transition`
## [1] "Sfrp1"
## 
## $`positive regulation of protein-containing complex disassembly`
## [1] "Wnk1"
## 
## $`negative regulation of JNK cascade`
## [1] "Sfrp1"
## 
## $`tRNA aminoacylation for protein translation`
## [1] "Lars2"
## 
## $`hyperosmotic response`
## [1] "Wnk1"
## 
## $`negative regulation of osteoclast differentiation`
## [1] "Sfrp1"
## 
## $`cellular response to estrogen stimulus`
## [1] "Sfrp1"
## 
## $`negative regulation of protein localization to membrane`
## [1] "Wnk1"
## 
## $`one-carbon metabolic process`
## [1] "Car15"
## 
## $`negative regulation of intracellular steroid hormone receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`lymphocyte chemotaxis`
## [1] "Wnk1"
## 
## $`response to prostaglandin`
## [1] "Sfrp1"
## 
## $`metanephric nephron development`
## [1] "Irx2"
## 
## $`regulation of DNA-templated DNA replication`
## [1] "Dynll1"
## 
## $`tRNA aminoacylation`
## [1] "Lars2"
## 
## $`positive regulation of smoothened signaling pathway`
## [1] "Sfrp1"
## 
## $`positive regulation of lymphocyte migration`
## [1] "Wnk1"
## 
## $`amino acid activation`
## [1] "Lars2"
## 
## $`hematopoietic stem cell differentiation`
## [1] "Sfrp1"
## 
## $`positive regulation of cytokinesis`
## [1] "Wnk1"
## 
## $`negative regulation of fibroblast proliferation`
## [1] "Sfrp1"
## 
## $`negative regulation of ossification`
## [1] "Sfrp1"
## 
## $`androgen receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`positive regulation of potassium ion transport`
## [1] "Wnk1"
## 
## $`protein insertion into membrane`
## [1] "Wnk1"
## 
## $`dopaminergic neuron differentiation`
## [1] "Sfrp1"
## 
## $`potassium ion import across plasma membrane`
## [1] "Wnk1"
## 
## $`regulation of extrinsic apoptotic signaling pathway via death domain receptors`
## [1] "Sfrp1"
## 
## $`midbrain development`
## [1] "Sfrp1"
## 
## $`replication fork processing`
## [1] "Dynll1"
## 
## $`positive regulation of insulin secretion involved in cellular response to glucose stimulus`
## [1] "Dynll1"
## 
## $`regulation of cell adhesion mediated by integrin`
## [1] "Wnk1"
## 
## $`negative regulation of peptidyl-tyrosine phosphorylation`
## [1] "Sfrp1"
## 
## $`regulation of T cell migration`
## [1] "Wnk1"
## 
## $`cellular response to nutrient`
## [1] "Sfrp1"
## 
## $`negative regulation of MAP kinase activity`
## [1] "Sfrp1"
## 
## $`regulation of digestive system process`
## [1] "Wnk1"
## 
## $`intraciliary transport`
## [1] "Dynll1"
## 
## $`trabecula morphogenesis`
## [1] "Sfrp1"
## 
## $`DNA-templated DNA replication maintenance of fidelity`
## [1] "Dynll1"
## 
## $`digestive tract morphogenesis`
## [1] "Sfrp1"
## 
## $`secretion by tissue`
## [1] "Wnk1"
## 
## $`Rac protein signal transduction`
## [1] "Dynlt1f"
## 
## $`positive regulation of blood pressure`
## [1] "Wnk1"
## 
## $`regulation of mitochondrial membrane permeability`
## [1] "Dynlt1f"
## 
## $`mitochondrion localization`
## [1] "Dynll1"
## 
## $`regulation of sodium ion transmembrane transport`
## [1] "Wnk1"
## 
## $`prostate gland development`
## [1] "Sfrp1"
## 
## $`negative regulation of BMP signaling pathway`
## [1] "Sfrp1"
## 
## $`heterotypic cell-cell adhesion`
## [1] "Wnk1"
## 
## $`non-canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`morphogenesis of a polarized epithelium`
## [1] "Sfrp1"
## 
## $`negative regulation of myeloid leukocyte differentiation`
## [1] "Sfrp1"
## 
## $`regulation of bone remodeling`
## [1] "Sfrp1"
## 
## $`regulation of JUN kinase activity`
## [1] "Sfrp1"
## 
## $`negative regulation of lymphocyte differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of insulin secretion`
## [1] "Sfrp1"
## 
## $`regulation of morphogenesis of a branching structure`
## [1] "Sfrp1"
## 
## $`positive regulation of extrinsic apoptotic signaling pathway`
## [1] "Sfrp1"
## 
## $`regulation of lymphocyte migration`
## [1] "Wnk1"
## 
## $`positive regulation of fat cell differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of osteoblast differentiation`
## [1] "Sfrp1"
## 
## $`T cell migration`
## [1] "Wnk1"
## 
## $`mRNA export from nucleus`
## [1] "Wnk1"
## 
## $`regulation of morphogenesis of an epithelium`
## [1] "Sfrp1"
## 
## $`non-motile cilium assembly`
## [1] "Dynll1"
## 
## $`urogenital system development`
## [1] "Sfrp1"
## 
## $somitogenesis
## [1] "Sfrp1"
## 
## $`cardiac muscle cell apoptotic process`
## [1] "Dynlt1f"
## 
## $`regulation of membrane permeability`
## [1] "Dynlt1f"
## 
## $`regulation of nitric oxide biosynthetic process`
## [1] "Dynll1"
## 
## $`negative regulation of peptide hormone secretion`
## [1] "Sfrp1"
## 
## $`striated muscle cell apoptotic process`
## [1] "Dynlt1f"
## 
## $`positive regulation of small GTPase mediated signal transduction`
## [1] "Dynlt1f"
## 
## $`cellular response to osmotic stress`
## [1] "Wnk1"
## 
## $`negative regulation of peptide secretion`
## [1] "Sfrp1"
## 
## $`regulation of cilium assembly`
## [1] "Dynll1"
## 
## $`regulation of nitric oxide metabolic process`
## [1] "Dynll1"
## 
## $`regulation of intracellular steroid hormone receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`cellular response to interleukin-1`
## [1] "Sfrp1"

6.2 Type 3 Downregulated Control asbence of low salt

# Arrange and filter DEGs for type 3
df <- type_3 %>% arrange(desc(avg_log2FC))

df2 <- df %>% filter(p_val_adj < 0.05)

DEG_list <- df

markers3down <- DEG_list %>% rownames_to_column(var="SYMBOL")

ENTREZ_list <- bitr(
  geneID = rownames(DEG_list),
  fromType = "SYMBOL",
  toType = "ENTREZID",
  OrgDb = org.Mm.eg.db
)
## 'select()' returned 1:1 mapping between keys and columns
## Warning in bitr(geneID = rownames(DEG_list), fromType = "SYMBOL", toType =
## "ENTREZID", : 2.03% of input gene IDs are fail to map...
markers3down <- ENTREZ_list %>% inner_join(markers3down, by = "SYMBOL")

markers3down <- markers3down %>% dplyr::filter(p_val_adj < 0.05)
#head(markers3down, n = 50)

pos.markers3down <- markers3down %>% dplyr::filter(avg_log2FC < 0) %>% arrange(desc(abs(avg_log2FC)))
# You can adjust the log2FC threshold here if you want a stricter cutoff

pos.ranks3down <- pos.markers3down$ENTREZID[abs(pos.markers3down$avg_log2FC) > 0]
#head(pos.ranks3down)

pos_go3down <- enrichGO(
  gene = pos.ranks3down,           # a vector of entrez gene id
  OrgDb = org.Mm.eg.db,    
  ont = "BP",
  readable = TRUE                  # whether mapping gene ID to gene Name
)

pos_go3down
## #
## # over-representation test
## #
## #...@organism     Mus musculus 
## #...@ontology     BP 
## #...@keytype      ENTREZID 
## #...@gene     chr [1:8] "13653" "11461" "54405" "378702" "66091" "17992" "12864" "12868"
## #...pvalues adjusted by 'BH' with cutoff <0.05 
## #...98 enriched terms found
## 'data.frame':    98 obs. of  12 variables:
##  $ ID            : chr  "GO:0006119" "GO:0009060" "GO:0045333" "GO:0015980" ...
##  $ Description   : chr  "oxidative phosphorylation" "aerobic respiration" "cellular respiration" "energy derivation by oxidation of organic compounds" ...
##  $ GeneRatio     : chr  "4/8" "4/8" "4/8" "4/8" ...
##  $ BgRatio       : chr  "154/28928" "206/28928" "271/28928" "380/28928" ...
##  $ RichFactor    : num  0.026 0.0194 0.0148 0.0105 0.0308 ...
##  $ FoldEnrichment: num  93.9 70.2 53.4 38.1 111.3 ...
##  $ zScore        : num  19.2 16.6 14.4 12.1 14.8 ...
##  $ pvalue        : num  5.32e-08 1.71e-07 5.12e-07 1.97e-06 1.38e-04 ...
##  $ p.adjust      : num  1.56e-05 2.51e-05 5.02e-05 1.45e-04 6.16e-03 ...
##  $ qvalue        : num  5.88e-06 9.45e-06 1.89e-05 5.44e-05 2.32e-03 ...
##  $ geneID        : chr  "Ndufa1/Ndufa3/Cox6c/Cox8a" "Ndufa1/Ndufa3/Cox6c/Cox8a" "Ndufa1/Ndufa3/Cox6c/Cox8a" "Ndufa1/Ndufa3/Cox6c/Cox8a" ...
##  $ Count         : int  4 4 4 4 2 2 2 2 2 2 ...
## #...Citation
## G Yu. Thirteen years of clusterProfiler. The Innovation. 2024, 5(6):100722
chart3down <- dotplot(pos_go3down) +
  ggtitle("type 3 downregulated lowsalt") +
  theme_classic() + 
  theme(
    plot.title = element_text(hjust = 0.5),
    legend.position = "left",
    axis.text.y = element_text(hjust = 0, size = 10)
  ) +
  scale_y_discrete(
    position = "right", 
    labels = function(x) str_wrap(x, width = 25)
  )  # Wrap y-axis labels to 2 lines
## Scale for y is already present.
## Adding another scale for y, which will replace the existing scale.
chart3down

6.3 Gene View Down regulated

pathway_type3down <- strsplit(pos_go3down$geneID, "/")

names(pathway_type3down) <- pos_go3down$Description 

pathway_type3down
## $`oxidative phosphorylation`
## [1] "Ndufa1" "Ndufa3" "Cox6c"  "Cox8a" 
## 
## $`aerobic respiration`
## [1] "Ndufa1" "Ndufa3" "Cox6c"  "Cox8a" 
## 
## $`cellular respiration`
## [1] "Ndufa1" "Ndufa3" "Cox6c"  "Cox8a" 
## 
## $`energy derivation by oxidation of organic compounds`
## [1] "Ndufa1" "Ndufa3" "Cox6c"  "Cox8a" 
## 
## $`NADH dehydrogenase complex assembly`
## [1] "Ndufa1" "Ndufa3"
## 
## $`mitochondrial respiratory chain complex I assembly`
## [1] "Ndufa1" "Ndufa3"
## 
## $`proton motive force-driven mitochondrial ATP synthesis`
## [1] "Ndufa1" "Ndufa3"
## 
## $`proton motive force-driven ATP synthesis`
## [1] "Ndufa1" "Ndufa3"
## 
## $`ATP biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`mitochondrial respiratory chain complex assembly`
## [1] "Ndufa1" "Ndufa3"
## 
## $`purine ribonucleoside triphosphate biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`mitochondrial respirasome assembly`
## [1] "Ndufa1" "Ndufa3"
## 
## $`purine nucleoside triphosphate biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`ribonucleoside triphosphate biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`nucleoside triphosphate biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`purine ribonucleotide biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`ribonucleotide biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`ribose phosphate biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`purine nucleotide biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`regulation of transmembrane transporter activity`
## [1] "Actb"   "Ndufa4"
## 
## $`regulation of transporter activity`
## [1] "Actb"   "Ndufa4"
## 
## $`nucleotide biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`ATP metabolic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`purine-containing compound biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`purine ribonucleoside triphosphate metabolic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`ribonucleoside triphosphate metabolic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`purine nucleoside triphosphate metabolic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`positive regulation of cell proliferation involved in kidney development`
## [1] "Egr1"
## 
## $`nucleoside triphosphate metabolic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`positive regulation of gene expression via chromosomal CpG island demethylation`
## [1] "Egr1"
## 
## $`cell proliferation involved in metanephros development`
## [1] "Egr1"
## 
## $`nucleoside phosphate biosynthetic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`regulation of glomerular mesangial cell proliferation`
## [1] "Egr1"
## 
## $`adherens junction assembly`
## [1] "Actb"
## 
## $`glomerular mesangial cell proliferation`
## [1] "Egr1"
## 
## $`T cell differentiation`
## [1] "Egr1" "Actb"
## 
## $`positive regulation of hormone biosynthetic process`
## [1] "Egr1"
## 
## $`cellular response to electrical stimulus`
## [1] "Actb"
## 
## $`apical protein localization`
## [1] "Actb"
## 
## $`purine ribonucleotide metabolic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`regulation of cell proliferation involved in kidney development`
## [1] "Egr1"
## 
## $`ribonucleotide metabolic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`estrous cycle`
## [1] "Egr1"
## 
## $`metanephric glomerulus development`
## [1] "Egr1"
## 
## $`ribose phosphate metabolic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`glomerular mesangium development`
## [1] "Egr1"
## 
## $`catecholamine uptake`
## [1] "Actb"
## 
## $`cellular response to abiotic stimulus`
## [1] "Egr1" "Actb"
## 
## $`cellular response to environmental stimulus`
## [1] "Egr1" "Actb"
## 
## $`mitochondrial electron transport, cytochrome c to oxygen`
## [1] "Cox8a"
## 
## $`progesterone metabolic process`
## [1] "Egr1"
## 
## $`C21-steroid hormone biosynthetic process`
## [1] "Egr1"
## 
## $`regulation of ketone biosynthetic process`
## [1] "Egr1"
## 
## $`cell proliferation involved in kidney development`
## [1] "Egr1"
## 
## $`purine nucleotide metabolic process`
## [1] "Ndufa1" "Ndufa3"
## 
## $`postsynaptic actin cytoskeleton organization`
## [1] "Actb"
## 
## $`negative regulation of cyclin-dependent protein kinase activity`
## [1] "Actb"
## 
## $`regulation of proton transport`
## [1] "Ndufa4"
## 
## $`positive regulation of hormone metabolic process`
## [1] "Egr1"
## 
## $`lymphocyte differentiation`
## [1] "Egr1" "Actb"
## 
## $`regulation of protein sumoylation`
## [1] "Egr1"
## 
## $`protein localization to cell-cell junction`
## [1] "Actb"
## 
## $`interleukin-1-mediated signaling pathway`
## [1] "Egr1"
## 
## $`regulation of nucleotide-excision repair`
## [1] "Actb"
## 
## $`locomotor rhythm`
## [1] "Egr1"
## 
## $`cellular response to gamma radiation`
## [1] "Egr1"
## 
## $`postsynaptic cytoskeleton organization`
## [1] "Actb"
## 
## $`regulation of hormone biosynthetic process`
## [1] "Egr1"
## 
## $`glomerulus vasculature development`
## [1] "Egr1"
## 
## $`olefinic compound biosynthetic process`
## [1] "Egr1"
## 
## $`norepinephrine transport`
## [1] "Actb"
## 
## $`renal system vasculature development`
## [1] "Egr1"
## 
## $`kidney vasculature development`
## [1] "Egr1"
## 
## $`regulation of synaptic vesicle endocytosis`
## [1] "Actb"
## 
## $`regulation of G0 to G1 transition`
## [1] "Actb"
## 
## $`positive regulation of oxidoreductase activity`
## [1] "Ndufa4"
## 
## $`transepithelial transport`
## [1] "Actb"
## 
## $`G0 to G1 transition`
## [1] "Actb"
## 
## $`regulation of long-term neuronal synaptic plasticity`
## [1] "Egr1"
## 
## $`regulation of synaptic vesicle recycling`
## [1] "Actb"
## 
## $`metanephric nephron development`
## [1] "Egr1"
## 
## $`positive regulation of double-strand break repair via homologous recombination`
## [1] "Actb"
## 
## $`steroid hormone biosynthetic process`
## [1] "Egr1"
## 
## $`C21-steroid hormone metabolic process`
## [1] "Egr1"
## 
## $`long-term memory`
## [1] "Egr1"
## 
## $`protein sumoylation`
## [1] "Egr1"
## 
## $`positive regulation of stem cell population maintenance`
## [1] "Actb"
## 
## $`ketone biosynthetic process`
## [1] "Egr1"
## 
## $`positive regulation of myoblast differentiation`
## [1] "Actb"
## 
## $`regulation of cyclin-dependent protein kinase activity`
## [1] "Actb"
## 
## $`regulation of hormone metabolic process`
## [1] "Egr1"
## 
## $`response to electrical stimulus`
## [1] "Actb"
## 
## $`response to gamma radiation`
## [1] "Egr1"
## 
## $`transcription initiation-coupled chromatin remodeling`
## [1] "Egr1"
## 
## $`positive regulation of miRNA transcription`
## [1] "Egr1"
## 
## $`protein destabilization`
## [1] "Serf2"
## 
## $`adherens junction organization`
## [1] "Actb"
## 
## $`positive regulation of gene expression, epigenetic`
## [1] "Egr1"

7 Type 4

7.1 Type 4 Upregulated lowsalt

# Arrange and filter DEGs for type 4
df <- type_4 %>% arrange(desc(avg_log2FC))

df2 <- df %>% filter(p_val_adj < 0.05)

DEG_list <- df2

markers4up <- DEG_list %>% rownames_to_column(var="SYMBOL")

ENTREZ_list <- bitr(
  geneID = rownames(DEG_list),
  fromType = "SYMBOL",
  toType = "ENTREZID",
  OrgDb = org.Mm.eg.db
)
## 'select()' returned 1:1 mapping between keys and columns
markers4up <- ENTREZ_list %>% inner_join(markers4up, by = "SYMBOL")

markers4up <- markers4up %>% dplyr::filter(p_val_adj < 0.05)
#head(markers4up, n = 50)

pos.markers4up <- markers4up %>% dplyr::filter(avg_log2FC > 0) %>% arrange(desc(abs(avg_log2FC)))
# Adjust avg_log2FC threshold as needed

pos.ranks4up <- pos.markers4up$ENTREZID[abs(pos.markers4up$avg_log2FC) > 0]
#head(pos.ranks4up)

pos_go4up <- enrichGO(
  gene = pos.ranks4up,           # a vector of entrez gene id
  OrgDb = org.Mm.eg.db,    
  ont = "BP",
  readable = TRUE                # whether mapping gene ID to gene Name
)

pos_go4up
## #
## # over-representation test
## #
## #...@organism     Mus musculus 
## #...@ontology     BP 
## #...@keytype      ENTREZID 
## #...@gene     chr "20377"
## #...pvalues adjusted by 'BH' with cutoff <0.05 
## #...285 enriched terms found
## 'data.frame':    285 obs. of  12 variables:
##  $ ID            : chr  "GO:0071481" "GO:1904338" "GO:0060525" "GO:0009950" ...
##  $ Description   : chr  "cellular response to X-ray" "regulation of dopaminergic neuron differentiation" "prostate glandular acinus development" "dorsal/ventral axis specification" ...
##  $ GeneRatio     : chr  "1/1" "1/1" "1/1" "1/1" ...
##  $ BgRatio       : chr  "11/28928" "11/28928" "12/28928" "13/28928" ...
##  $ RichFactor    : num  0.0909 0.0909 0.0833 0.0769 0.0769 ...
##  $ FoldEnrichment: num  2630 2630 2411 2225 2225 ...
##  $ zScore        : num  51.3 51.3 49.1 47.2 47.2 ...
##  $ pvalue        : num  0.00038 0.00038 0.000415 0.000449 0.000449 ...
##  $ p.adjust      : num  0.00842 0.00842 0.00842 0.00842 0.00842 ...
##  $ qvalue        : logi  NA NA NA NA NA NA ...
##  $ geneID        : chr  "Sfrp1" "Sfrp1" "Sfrp1" "Sfrp1" ...
##  $ Count         : int  1 1 1 1 1 1 1 1 1 1 ...
## #...Citation
## G Yu. Thirteen years of clusterProfiler. The Innovation. 2024, 5(6):100722
chart4up <- dotplot(pos_go4up) +
  ggtitle("type 4 upregulated lowsalt") +
  theme_classic() + 
  theme(
    plot.title = element_text(hjust = 0.5),
    legend.position = "left",
    axis.text.y = element_text(hjust = 0, size = 10)
  ) +
  scale_y_discrete(
    position = "right", 
    labels = function(x) str_wrap(x, width = 25)
  )  # Wrap y-axis labels to 2 lines
## Scale for y is already present.
## Adding another scale for y, which will replace the existing scale.
chart4up

7.2 Gene View Upregulated

pathway_type4up <- strsplit(pos_go4up$geneID, "/")

names(pathway_type4up) <- pos_go4up$Description 

pathway_type4up
## $`cellular response to X-ray`
## [1] "Sfrp1"
## 
## $`regulation of dopaminergic neuron differentiation`
## [1] "Sfrp1"
## 
## $`prostate glandular acinus development`
## [1] "Sfrp1"
## 
## $`dorsal/ventral axis specification`
## [1] "Sfrp1"
## 
## $`negative regulation of osteoblast proliferation`
## [1] "Sfrp1"
## 
## $`positive regulation of fibroblast apoptotic process`
## [1] "Sfrp1"
## 
## $`bone trabecula formation`
## [1] "Sfrp1"
## 
## $`positive regulation of extrinsic apoptotic signaling pathway via death domain receptors`
## [1] "Sfrp1"
## 
## $`midbrain dopaminergic neuron differentiation`
## [1] "Sfrp1"
## 
## $`neural crest formation`
## [1] "Sfrp1"
## 
## $`branching involved in prostate gland morphogenesis`
## [1] "Sfrp1"
## 
## $`cellular response to prostaglandin E stimulus`
## [1] "Sfrp1"
## 
## $`negative regulation of JUN kinase activity`
## [1] "Sfrp1"
## 
## $`positive regulation of non-canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`convergent extension`
## [1] "Sfrp1"
## 
## $`negative regulation of androgen receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`bone trabecula morphogenesis`
## [1] "Sfrp1"
## 
## $`cellular response to prostaglandin stimulus`
## [1] "Sfrp1"
## 
## $`negative regulation of bone remodeling`
## [1] "Sfrp1"
## 
## $`regulation of type B pancreatic cell proliferation`
## [1] "Sfrp1"
## 
## $`cellular response to vitamin D`
## [1] "Sfrp1"
## 
## $`regulation of fibroblast apoptotic process`
## [1] "Sfrp1"
## 
## $`response to X-ray`
## [1] "Sfrp1"
## 
## $`negative regulation of tissue remodeling`
## [1] "Sfrp1"
## 
## $`regulation of androgen receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`regulation of non-canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`fibroblast apoptotic process`
## [1] "Sfrp1"
## 
## $`trabecula formation`
## [1] "Sfrp1"
## 
## $`cellular response to vitamin`
## [1] "Sfrp1"
## 
## $`regulation of osteoblast proliferation`
## [1] "Sfrp1"
## 
## $`Wnt signaling pathway, planar cell polarity pathway`
## [1] "Sfrp1"
## 
## $`prostate gland epithelium morphogenesis`
## [1] "Sfrp1"
## 
## $`prostate gland morphogenesis`
## [1] "Sfrp1"
## 
## $`axis elongation`
## [1] "Sfrp1"
## 
## $`response to vitamin D`
## [1] "Sfrp1"
## 
## $`response to prostaglandin E`
## [1] "Sfrp1"
## 
## $`negative regulation of B cell activation`
## [1] "Sfrp1"
## 
## $`osteoblast proliferation`
## [1] "Sfrp1"
## 
## $`cellular response to estradiol stimulus`
## [1] "Sfrp1"
## 
## $`establishment of planar polarity`
## [1] "Sfrp1"
## 
## $`establishment of tissue polarity`
## [1] "Sfrp1"
## 
## $`type B pancreatic cell proliferation`
## [1] "Sfrp1"
## 
## $`regulation of B cell differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of epithelial to mesenchymal transition`
## [1] "Sfrp1"
## 
## $`negative regulation of JNK cascade`
## [1] "Sfrp1"
## 
## $`negative regulation of osteoclast differentiation`
## [1] "Sfrp1"
## 
## $`cellular response to estrogen stimulus`
## [1] "Sfrp1"
## 
## $`negative regulation of intracellular steroid hormone receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`response to prostaglandin`
## [1] "Sfrp1"
## 
## $`positive regulation of smoothened signaling pathway`
## [1] "Sfrp1"
## 
## $`hematopoietic stem cell differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of fibroblast proliferation`
## [1] "Sfrp1"
## 
## $`negative regulation of ossification`
## [1] "Sfrp1"
## 
## $`androgen receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`dopaminergic neuron differentiation`
## [1] "Sfrp1"
## 
## $`regulation of extrinsic apoptotic signaling pathway via death domain receptors`
## [1] "Sfrp1"
## 
## $`midbrain development`
## [1] "Sfrp1"
## 
## $`negative regulation of peptidyl-tyrosine phosphorylation`
## [1] "Sfrp1"
## 
## $`cellular response to nutrient`
## [1] "Sfrp1"
## 
## $`negative regulation of MAP kinase activity`
## [1] "Sfrp1"
## 
## $`trabecula morphogenesis`
## [1] "Sfrp1"
## 
## $`digestive tract morphogenesis`
## [1] "Sfrp1"
## 
## $`prostate gland development`
## [1] "Sfrp1"
## 
## $`negative regulation of BMP signaling pathway`
## [1] "Sfrp1"
## 
## $`non-canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`morphogenesis of a polarized epithelium`
## [1] "Sfrp1"
## 
## $`negative regulation of myeloid leukocyte differentiation`
## [1] "Sfrp1"
## 
## $`regulation of bone remodeling`
## [1] "Sfrp1"
## 
## $`regulation of JUN kinase activity`
## [1] "Sfrp1"
## 
## $`negative regulation of lymphocyte differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of insulin secretion`
## [1] "Sfrp1"
## 
## $`regulation of morphogenesis of a branching structure`
## [1] "Sfrp1"
## 
## $`positive regulation of extrinsic apoptotic signaling pathway`
## [1] "Sfrp1"
## 
## $`positive regulation of fat cell differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of osteoblast differentiation`
## [1] "Sfrp1"
## 
## $`regulation of morphogenesis of an epithelium`
## [1] "Sfrp1"
## 
## $`urogenital system development`
## [1] "Sfrp1"
## 
## $somitogenesis
## [1] "Sfrp1"
## 
## $`negative regulation of peptide hormone secretion`
## [1] "Sfrp1"
## 
## $`negative regulation of peptide secretion`
## [1] "Sfrp1"
## 
## $`regulation of intracellular steroid hormone receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`cellular response to interleukin-1`
## [1] "Sfrp1"
## 
## $`cellular response to ionizing radiation`
## [1] "Sfrp1"
## 
## $`extrinsic apoptotic signaling pathway via death domain receptors`
## [1] "Sfrp1"
## 
## $`regulation of tissue remodeling`
## [1] "Sfrp1"
## 
## $`somatic stem cell population maintenance`
## [1] "Sfrp1"
## 
## $`regulation of osteoclast differentiation`
## [1] "Sfrp1"
## 
## $`somite development`
## [1] "Sfrp1"
## 
## $`negative regulation of protein serine/threonine kinase activity`
## [1] "Sfrp1"
## 
## $`response to vitamin`
## [1] "Sfrp1"
## 
## $`negative regulation of myeloid cell differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of protein secretion`
## [1] "Sfrp1"
## 
## $`dorsal/ventral pattern formation`
## [1] "Sfrp1"
## 
## $`regulation of smoothened signaling pathway`
## [1] "Sfrp1"
## 
## $`neural crest cell differentiation`
## [1] "Sfrp1"
## 
## $`substrate adhesion-dependent cell spreading`
## [1] "Sfrp1"
## 
## $`regulation of animal organ morphogenesis`
## [1] "Sfrp1"
## 
## $`response to interleukin-1`
## [1] "Sfrp1"
## 
## $`axis specification`
## [1] "Sfrp1"
## 
## $`response to estrogen`
## [1] "Sfrp1"
## 
## $`negative regulation of hormone secretion`
## [1] "Sfrp1"
## 
## $`neural tube closure`
## [1] "Sfrp1"
## 
## $`regulation of epithelial to mesenchymal transition`
## [1] "Sfrp1"
## 
## $`regulation of BMP signaling pathway`
## [1] "Sfrp1"
## 
## $`tube closure`
## [1] "Sfrp1"
## 
## $`negative regulation of cellular response to growth factor stimulus`
## [1] "Sfrp1"
## 
## $`bone remodeling`
## [1] "Sfrp1"
## 
## $`positive regulation of canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`cellular response to fibroblast growth factor stimulus`
## [1] "Sfrp1"
## 
## $`ureteric bud development`
## [1] "Sfrp1"
## 
## $`primary neural tube formation`
## [1] "Sfrp1"
## 
## $`mesonephric epithelium development`
## [1] "Sfrp1"
## 
## $`mesonephric tubule development`
## [1] "Sfrp1"
## 
## $segmentation
## [1] "Sfrp1"
## 
## $`response to fibroblast growth factor`
## [1] "Sfrp1"
## 
## $`mesonephros development`
## [1] "Sfrp1"
## 
## $`nuclear receptor-mediated steroid hormone signaling pathway`
## [1] "Sfrp1"
## 
## $`response to estradiol`
## [1] "Sfrp1"
## 
## $`negative regulation of leukocyte differentiation`
## [1] "Sfrp1"
## 
## $`regulation of fibroblast proliferation`
## [1] "Sfrp1"
## 
## $`neural tube formation`
## [1] "Sfrp1"
## 
## $`steroid hormone receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`negative regulation of hemopoiesis`
## [1] "Sfrp1"
## 
## $`female gonad development`
## [1] "Sfrp1"
## 
## $`osteoclast differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`development of primary female sexual characteristics`
## [1] "Sfrp1"
## 
## $`positive regulation of Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`negative regulation of protein transport`
## [1] "Sfrp1"
## 
## $`regulation of ossification`
## [1] "Sfrp1"
## 
## $`digestive tract development`
## [1] "Sfrp1"
## 
## $`regulation of B cell activation`
## [1] "Sfrp1"
## 
## $`regulation of fat cell differentiation`
## [1] "Sfrp1"
## 
## $`embryonic epithelial tube formation`
## [1] "Sfrp1"
## 
## $`regulation of myeloid leukocyte differentiation`
## [1] "Sfrp1"
## 
## $`fibroblast proliferation`
## [1] "Sfrp1"
## 
## $`negative regulation of transmembrane receptor protein serine/threonine kinase signaling pathway`
## [1] "Sfrp1"
## 
## $`response to ionizing radiation`
## [1] "Sfrp1"
## 
## $`B cell differentiation`
## [1] "Sfrp1"
## 
## $`regulation of MAP kinase activity`
## [1] "Sfrp1"
## 
## $`cellular response to hypoxia`
## [1] "Sfrp1"
## 
## $`gland morphogenesis`
## [1] "Sfrp1"
## 
## $`digestive system development`
## [1] "Sfrp1"
## 
## $`negative regulation of establishment of protein localization`
## [1] "Sfrp1"
## 
## $`regulation of osteoblast differentiation`
## [1] "Sfrp1"
## 
## $`regulation of JNK cascade`
## [1] "Sfrp1"
## 
## $`epithelial tube formation`
## [1] "Sfrp1"
## 
## $`smoothened signaling pathway`
## [1] "Sfrp1"
## 
## $`female sex differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`negative regulation of epithelial cell proliferation`
## [1] "Sfrp1"
## 
## $`epithelial to mesenchymal transition`
## [1] "Sfrp1"
## 
## $`BMP signaling pathway`
## [1] "Sfrp1"
## 
## $`kidney epithelium development`
## [1] "Sfrp1"
## 
## $`regulation of extrinsic apoptotic signaling pathway`
## [1] "Sfrp1"
## 
## $`negative regulation of protein kinase activity`
## [1] "Sfrp1"
## 
## $`response to nutrient`
## [1] "Sfrp1"
## 
## $`negative regulation of lymphocyte activation`
## [1] "Sfrp1"
## 
## $`nuclear receptor-mediated signaling pathway`
## [1] "Sfrp1"
## 
## $`tube formation`
## [1] "Sfrp1"
## 
## $`negative regulation of MAPK cascade`
## [1] "Sfrp1"
## 
## $`positive regulation of apoptotic signaling pathway`
## [1] "Sfrp1"
## 
## $`morphogenesis of embryonic epithelium`
## [1] "Sfrp1"
## 
## $`response to BMP`
## [1] "Sfrp1"
## 
## $`cellular response to BMP stimulus`
## [1] "Sfrp1"
## 
## $`male gonad development`
## [1] "Sfrp1"
## 
## $`cellular response to ketone`
## [1] "Sfrp1"
## 
## $`development of primary male sexual characteristics`
## [1] "Sfrp1"
## 
## $`cellular response to alcohol`
## [1] "Sfrp1"
## 
## $`cellular response to radiation`
## [1] "Sfrp1"
## 
## $`hematopoietic progenitor cell differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of kinase activity`
## [1] "Sfrp1"
## 
## $`cellular response to decreased oxygen levels`
## [1] "Sfrp1"
## 
## $`neural tube development`
## [1] "Sfrp1"
## 
## $`negative regulation of cell growth`
## [1] "Sfrp1"
## 
## $`JNK cascade`
## [1] "Sfrp1"
## 
## $`negative regulation of secretion by cell`
## [1] "Sfrp1"
## 
## $`negative regulation of leukocyte activation`
## [1] "Sfrp1"
## 
## $`cellular response to starvation`
## [1] "Sfrp1"
## 
## $`cellular response to tumor necrosis factor`
## [1] "Sfrp1"
## 
## $gastrulation
## [1] "Sfrp1"
## 
## $`hormone-mediated signaling pathway`
## [1] "Sfrp1"
## 
## $`cellular response to oxygen levels`
## [1] "Sfrp1"
## 
## $`positive regulation of cell growth`
## [1] "Sfrp1"
## 
## $`negative regulation of transferase activity`
## [1] "Sfrp1"
## 
## $`male sex differentiation`
## [1] "Sfrp1"
## 
## $`cellular response to steroid hormone stimulus`
## [1] "Sfrp1"
## 
## $`negative regulation of secretion`
## [1] "Sfrp1"
## 
## $`tissue remodeling`
## [1] "Sfrp1"
## 
## $`stem cell population maintenance`
## [1] "Sfrp1"
## 
## $`negative regulation of cell activation`
## [1] "Sfrp1"
## 
## $`regulation of reproductive process`
## [1] "Sfrp1"
## 
## $`response to tumor necrosis factor`
## [1] "Sfrp1"
## 
## $`regulation of insulin secretion`
## [1] "Sfrp1"
## 
## $`morphogenesis of a branching epithelium`
## [1] "Sfrp1"
## 
## $`maintenance of cell number`
## [1] "Sfrp1"
## 
## $`regulation of lymphocyte differentiation`
## [1] "Sfrp1"
## 
## $`regulation of myeloid cell differentiation`
## [1] "Sfrp1"
## 
## $`anterior/posterior pattern specification`
## [1] "Sfrp1"
## 
## $`positive regulation of epithelial cell proliferation`
## [1] "Sfrp1"
## 
## $`osteoblast differentiation`
## [1] "Sfrp1"
## 
## $`response to starvation`
## [1] "Sfrp1"
## 
## $`regulation of peptidyl-tyrosine phosphorylation`
## [1] "Sfrp1"
## 
## $`regulation of neuron differentiation`
## [1] "Sfrp1"
## 
## $`extrinsic apoptotic signaling pathway`
## [1] "Sfrp1"
## 
## $`morphogenesis of a branching structure`
## [1] "Sfrp1"
## 
## $`central nervous system neuron differentiation`
## [1] "Sfrp1"
## 
## $`negative regulation of growth`
## [1] "Sfrp1"
## 
## $`negative regulation of protein localization`
## [1] "Sfrp1"
## 
## $`regulation of canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`mesenchymal cell differentiation`
## [1] "Sfrp1"
## 
## $`regulation of protein serine/threonine kinase activity`
## [1] "Sfrp1"
## 
## $`skeletal system morphogenesis`
## [1] "Sfrp1"
## 
## $`fat cell differentiation`
## [1] "Sfrp1"
## 
## $`insulin secretion`
## [1] "Sfrp1"
## 
## $`cellular response to nutrient levels`
## [1] "Sfrp1"
## 
## $`regulation of transmembrane receptor protein serine/threonine kinase signaling pathway`
## [1] "Sfrp1"
## 
## $`regulation of peptide hormone secretion`
## [1] "Sfrp1"
## 
## $`regulation of peptide secretion`
## [1] "Sfrp1"
## 
## $`cellular response to transforming growth factor beta stimulus`
## [1] "Sfrp1"
## 
## $`regulation of peptide transport`
## [1] "Sfrp1"
## 
## $`developmental growth involved in morphogenesis`
## [1] "Sfrp1"
## 
## $`response to transforming growth factor beta`
## [1] "Sfrp1"
## 
## $`myeloid leukocyte differentiation`
## [1] "Sfrp1"
## 
## $`gonad development`
## [1] "Sfrp1"
## 
## $`stem cell differentiation`
## [1] "Sfrp1"
## 
## $`peptidyl-tyrosine phosphorylation`
## [1] "Sfrp1"
## 
## $`development of primary sexual characteristics`
## [1] "Sfrp1"
## 
## $`peptidyl-tyrosine modification`
## [1] "Sfrp1"
## 
## $`canonical Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`negative regulation of cell development`
## [1] "Sfrp1"
## 
## $`cell fate commitment`
## [1] "Sfrp1"
## 
## $`negative regulation of protein phosphorylation`
## [1] "Sfrp1"
## 
## $`response to ketone`
## [1] "Sfrp1"
## 
## $`B cell activation`
## [1] "Sfrp1"
## 
## $`positive regulation of growth`
## [1] "Sfrp1"
## 
## $`negative regulation of cell migration`
## [1] "Sfrp1"
## 
## $`mesenchyme development`
## [1] "Sfrp1"
## 
## $`regulation of Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`peptide hormone secretion`
## [1] "Sfrp1"
## 
## $`regulation of cellular response to growth factor stimulus`
## [1] "Sfrp1"
## 
## $`negative regulation of phosphorylation`
## [1] "Sfrp1"
## 
## $`peptide secretion`
## [1] "Sfrp1"
## 
## $`regulation of protein secretion`
## [1] "Sfrp1"
## 
## $`negative regulation of cell motility`
## [1] "Sfrp1"
## 
## $`response to hypoxia`
## [1] "Sfrp1"
## 
## $`regulation of hormone secretion`
## [1] "Sfrp1"
## 
## $`peptide transport`
## [1] "Sfrp1"
## 
## $`response to steroid hormone`
## [1] "Sfrp1"
## 
## $`negative regulation of locomotion`
## [1] "Sfrp1"
## 
## $`transforming growth factor beta receptor superfamily signaling pathway`
## [1] "Sfrp1"
## 
## $`sex differentiation`
## [1] "Sfrp1"
## 
## $`regulation of leukocyte differentiation`
## [1] "Sfrp1"
## 
## $`kidney development`
## [1] "Sfrp1"
## 
## $`cell-substrate adhesion`
## [1] "Sfrp1"
## 
## $`response to decreased oxygen levels`
## [1] "Sfrp1"
## 
## $`response to alcohol`
## [1] "Sfrp1"
## 
## $`reproductive structure development`
## [1] "Sfrp1"
## 
## $`negative regulation of phosphorus metabolic process`
## [1] "Sfrp1"
## 
## $`intracellular receptor signaling pathway`
## [1] "Sfrp1"
## 
## $`negative regulation of phosphate metabolic process`
## [1] "Sfrp1"
## 
## $`renal system development`
## [1] "Sfrp1"
## 
## $`reproductive system development`
## [1] "Sfrp1"
## 
## $`cellular response to abiotic stimulus`
## [1] "Sfrp1"
## 
## $`cellular response to environmental stimulus`
## [1] "Sfrp1"
## 
## $`epithelial tube morphogenesis`
## [1] "Sfrp1"
## 
## $`cell surface receptor protein serine/threonine kinase signaling pathway`
## [1] "Sfrp1"
## 
## $`amide transport`
## [1] "Sfrp1"
## 
## $`hormone secretion`
## [1] "Sfrp1"
## 
## $`negative regulation of protein modification process`
## [1] "Sfrp1"
## 
## $`hormone transport`
## [1] "Sfrp1"
## 
## $`regulation of epithelial cell proliferation`
## [1] "Sfrp1"
## 
## $`protein secretion`
## [1] "Sfrp1"
## 
## $`response to oxygen levels`
## [1] "Sfrp1"
## 
## $`establishment of protein localization to extracellular region`
## [1] "Sfrp1"
## 
## $`regulation of apoptotic signaling pathway`
## [1] "Sfrp1"
## 
## $`protein localization to extracellular region`
## [1] "Sfrp1"
## 
## $regionalization
## [1] "Sfrp1"
## 
## $`regulation of cell growth`
## [1] "Sfrp1"
## 
## $`regulation of hemopoiesis`
## [1] "Sfrp1"
## 
## $`Wnt signaling pathway`
## [1] "Sfrp1"
## 
## $`lymphocyte differentiation`
## [1] "Sfrp1"
## 
## $`response to radiation`
## [1] "Sfrp1"
## 
## $`regulation of protein kinase activity`
## [1] "Sfrp1"
## 
## $`response to xenobiotic stimulus`
## [1] "Sfrp1"

7.3 Type 4 Downregulated lowsalt

# Arrange and filter DEGs for type 4
df <- type_4 %>% arrange(desc(avg_log2FC))

df2 <- df %>% filter(p_val_adj < 0.05)

DEG_list <- df2

markers4down <- DEG_list %>% rownames_to_column(var="SYMBOL")

ENTREZ_list <- bitr(
  geneID = rownames(DEG_list),
  fromType = "SYMBOL",
  toType = "ENTREZID",
  OrgDb = org.Mm.eg.db
)
## 'select()' returned 1:1 mapping between keys and columns
markers4down <- ENTREZ_list %>% inner_join(markers4down, by = "SYMBOL")

markers4down <- markers4down %>% dplyr::filter(p_val_adj < 0.05)
#head(markers4down, n = 50)

pos.markers4down <- markers4down %>% dplyr::filter(avg_log2FC < 0) %>% arrange(desc(abs(avg_log2FC)))
# Adjust avg_log2FC threshold here if you want a stricter cutoff

pos.ranks4down <- pos.markers4down$ENTREZID[abs(pos.markers4down$avg_log2FC) > 0]
#head(pos.ranks4down)

pos_go4down <- enrichGO(
  gene = pos.ranks4down,           # a vector of entrez gene id
  OrgDb = org.Mm.eg.db,    
  ont = "BP",
  readable = TRUE                  # whether mapping gene ID to gene Name
)

pos_go4down
## #
## # over-representation test
## #
## #...@organism     Mus musculus 
## #...@ontology     BP 
## #...@keytype      ENTREZID 
## #...@gene     chr [1:2] "17750" "17748"
## #...pvalues adjusted by 'BH' with cutoff <0.05 
## #...18 enriched terms found
## 'data.frame':    18 obs. of  12 variables:
##  $ ID            : chr  "GO:0097501" "GO:0061687" "GO:0071280" "GO:0071294" ...
##  $ Description   : chr  "stress response to metal ion" "detoxification of inorganic compound" "cellular response to copper ion" "cellular response to zinc ion" ...
##  $ GeneRatio     : chr  "2/2" "2/2" "2/2" "2/2" ...
##  $ BgRatio       : chr  "13/28928" "16/28928" "18/28928" "20/28928" ...
##  $ RichFactor    : num  0.154 0.125 0.111 0.1 0.069 ...
##  $ FoldEnrichment: num  2225 1808 1607 1446 998 ...
##  $ zScore        : num  66.7 60.1 56.7 53.8 44.6 ...
##  $ pvalue        : num  1.86e-07 2.87e-07 3.66e-07 4.54e-07 9.70e-07 ...
##  $ p.adjust      : num  2.04e-06 2.04e-06 2.04e-06 2.04e-06 2.84e-06 ...
##  $ qvalue        : logi  NA NA NA NA NA NA ...
##  $ geneID        : chr  "Mt2/Mt1" "Mt2/Mt1" "Mt2/Mt1" "Mt2/Mt1" ...
##  $ Count         : int  2 2 2 2 2 2 2 2 2 2 ...
## #...Citation
## G Yu. Thirteen years of clusterProfiler. The Innovation. 2024, 5(6):100722
chart4down <- dotplot(pos_go4down) +
  ggtitle("type 4 downregulated lowsalt") +
  theme_classic() + 
  theme(
    plot.title = element_text(hjust = 0.5),
    legend.position = "left",
    axis.text.y = element_text(hjust = 0, size = 10)
  ) +
  scale_y_discrete(
    position = "right", 
    labels = function(x) str_wrap(x, width = 25)
  )  # Wrap y-axis labels to 2 lines
## Scale for y is already present.
## Adding another scale for y, which will replace the existing scale.
chart4down